add mime_type option to self-service ticket create, RT#7007
authorivan <ivan>
Fri, 12 Feb 2010 19:28:17 +0000 (19:28 +0000)
committerivan <ivan>
Fri, 12 Feb 2010 19:28:17 +0000 (19:28 +0000)
FS/FS/ClientAPI/MyAccount.pm
FS/FS/TicketSystem/RT_Internal.pm
fs_selfservice/java/freeside_create_ticket_example.java
fs_selfservice/perl/xmlrpc-create_ticket.pl

index 7fc1b60..927ebef 100644 (file)
@@ -1668,7 +1668,7 @@ sub create_ticket {
     'queue'   => $queue,
     'custnum' => $custnum,
     'svcnum'  => $session->{'svcnum'},
-    map { $_ => $p->{$_} } qw( requestor cc subject message )
+    map { $_ => $p->{$_} } qw( requestor cc subject message mime_type )
   );
 
   if ( ref($err_or_ticket) ) {
index d6b9c52..b1121ef 100644 (file)
@@ -138,6 +138,11 @@ Cc: email address or arrayref of addresses
 
 Ticket message
 
+=item mime_type
+
+MIME type to use for message.  Defaults to text/plain.  Specifying text/html
+can be useful to use HTML markup in message.
+
 =item custnum
 
 Customer number (see L<FS::cust_main>) to associate with ticket.
@@ -169,7 +174,7 @@ sub create_ticket {
 
   my $mimeobj = MIME::Entity->build(
     'Data' => $param{'message'},
-    'Type' => 'text/plain',
+    'Type' => ( $param{'mime_type'} || 'text/plain' ),
   );
 
   my %ticket = (
index e5228ee..357f69b 100755 (executable)
@@ -48,7 +48,9 @@ public class freeside_create_ticket_example {
       ticket_params.addElement( "subject" );
       ticket_params.addElement( "Houston, we have a problem." );
       ticket_params.addElement( "message" );
-      ticket_params.addElement( "The Oscillation Overthurster has gone out of alignment!\n\nIt needs to be fixed immediately!  http://linktest.freeside.biz/hi" );
+      ticket_params.addElement( "The Oscillation Overthurster has gone out of alignment!<br><br>It needs to be fixed immediately!  <A HREF=\"http://linktest.freeside.biz/hi\">link test</A>" );
+      ticket_params.addElement( "mime_type" );
+      ticket_params.addElement( "text/html" );
 
       HashMap ticket_result = client.execute( "create_ticket", ticket_params);
 
index ea11f21..0ccada2 100755 (executable)
@@ -27,7 +27,8 @@ my $t_result = $server->call('FS.SelfService.XMLRPC.create_ticket',
   'requestor'  => 'harveylala@example.com',
   'cc'         => 'chiquitabanana@example.com',
   'subject'    => 'Chiquita keeps sitting on me',
-  'message'    => "Isn't there something you can do about this?\n\nShe keeps waking me up!  http://linktest.freeside.biz/hi",
+  'message'    => 'Is there something you can do about this?<BR><BR>She keeps waking me up!  <A HREF="http://linktest.freeside.biz/hi">link test</A>',
+  'mime_type'  => 'text/html',
 );
 
 die $t_result->{'error'} if $t_result->{'error'};