Advance Sending email from Solution Manager (or CRM)
A solution for sending mail from Service Desk with attachments provided from the Solution Database or from the Activity
One of the most usefull areas of solution manager is the Service Desk. Unfortunately, even if its possible to attach a solution from the solution database to a Service request, in the outbound mail there is no possibility to send any kind of attachments to the “reported by” address.
This issue has two kind of impacts
- If the service team find a solution in the solution database with an attachment that explains how to fix the request, the operator has to send the solution in a different way (for example sending a mail from outlook).
- If the service team attach a document to an certain service request and want to send it to the “reported by” address, the only way to do so is download the file and send it then manually.
Creating a extended action send mail with attachment instead of the standard send email. This solution is also working on CRM systems for outboud email from CIC.
Starting from note 935670 (PPF: Sending an SF output with a main document), we extend with the following logic:
- Prepare a PDF from smart from (as in the standard).
- Determine all kind of attachments available (eg: check if the solution is correlate, check if there are attachments in the activity, etc).
- Show a popup to the end user, where to decide which kind of attachment need to be send.
- Send the mail.
More in detail
Determine witch action is need to be defined
In customizing, under Define Action Profile and Action (TCODE= CRMC_ACTION_DEF) we identify our Action profile (SLFN0001_ADVANCED), choosing Action Definition (SLFN0001_ADVANCED_MAIL) –> Processing type we found which class process the specific action: for this is the class CL_DOC_PROCESSING_CRM_ORDER- CRM_SRVORDER_EXEC_SMART_FORM.
So we can make new class ZSMCL_DOC_PROCESSING_CRM_ORDER based on CL_DOC_PROCESSING_CRM_ORDER and extend the method CRM_SRVORDER_EXEC_SMART_FORM.
After the statement
* determine the tables of the application CALL FUNCTION 'CRM_OUTPUT_SINGLE_READ' EXPORTING
iv_object = io_appl_object .... et_output_service_i_assi = lt_service_i_assi.
we can put our specific code for the get attachments:
At this point we have all the information needed in the table t_attach (id, name, source (Attach/SolutionDB), selected). We send all this information to the custom function module that shows the table t_attach and permit to the user to change the subject, write body mail and select the attachment.
prepare the mail
The rest of the code is as describe in oss note 935670, with an exception after the code
CALL METHOD document->add_attachment EXPORTING i_attachment_type = 'OTF' i_attachment_subject = ls_output_options-tdtitle i_attachment_size = l_otflen i_att_content_text = text.
Finally, the method ZSM_ATTACH_PHIO_DOCU (that physically attach the file to the mail) will be:
Now the only activity left is to copy and modify the original action definition SLFN0001_ADVANCED_MAIL with the new one SLFN0001_ADVANCED_MAIL_ATT; that uses the custom class ZSMCL_DOC_PROCESSING_CRM_ORDER
Now you are ready to choice the new action as follow:
and then the customer popup is displayed
Afterwards, in the mail client we will detect the mail sent by the system:
That’s all folks!
What will be developed in the future
- Starting from the business partner in the service request, the user can select one or more accounts to send the email with attachments.
- … suggestions will be appreciated…