Floe User-exits

Various User-Exits can be utilised for each document type in order to dynamically control the output.
 
User-exits are most commonly used to manipulate the SAP data passed into the Floe APIs to make it user-friendly, but also provide an enormously powerful array of controls.
 
To generate the user-exits, execute the IMG activity 'Maintain Email Type User-Exits', navigate to the Email Type through the selection tree, right-click on the Email Type and select the option ‘Generate user-exits’.  This task must be done once for a user-exit in order to create the user-exit code (methods).
 
 
The following user-exits are available. See the Examples section to explain how each user-exit can be used.
 
Attachment User-Exit
From Floe 210, attachments can be added to emails using the Floe Designer application. 
Use this user-exit if you wish to add dynamic logic to determine one or more attachments to the generated email.
Add the attachment in XSTRING format, the attachment name and the attachment description to the attachment table.
 
Email Body User-Exit
Use this user-exit if you wish to manipulate the generated document prior to sending.  
The entire document is available to be changed.  Content can be added, removed or manipulated as required.
 
Email Data User-Exit
This is the most common user-exit.  Use this user-exit if you wish to fill or manipulate variable values at run-time.   
Typically, the data is determined based on the document reference (im_document).  
Use this user-exit to format dates, currencies and quantities, or to replace SAP object codes with descriptions.
 
When the variable repeats, a row number must be set.
For nested repeating variables, the row number and the parent row number must be set.
Methods /floe/core=>get_data_from_structure and /floe/core=>get_data_from_table are available to convert field values from structures or tables into the Floe variable table format.
 
Email Recipient User-Exit
Use this user-exit to determine one or more recipients for an email.
Note that all the recipients are added to a single e-mail; a separate e-mail per recipient is not generated. [For this behaviour, use a Recipient List instead.]
 
For each recipient you must set the e-mail type (TO, CC, BCC).
You can also change the e-mail communication language.
 
Email Sender User-Exit
When a FLOE e-mail is sent the email sender address is determined globally by the "Email Sender Address" field in "System Settings" or it can be over-ridden by individual e-mail type if a value has been maintained for the "Email Sender Address" field in the "Maintain Email Types" transaction.
This user-exit enables the sender for a particular email to be dynamically determined. 
 
HTML Block Determination User-Exit
In general this is no longer used, since logic can be added in Floe Designer to dynamically determine content blocks.
This user-exit can be used to add additional logic to redetermine the content blocks to be included in the generated document/email/text.
 
Image User-Exit
In general this is no longer used, since images are rarely embedded into the email content, but stored on a cloud repository instead.
Use this user-exit if you wish to embed one or more images into the body of the generated e-mail.
Link each image to a variable code to store the content ID, and fill each content ID variables in the Email Data User-Exit.
 
Inbound User-Exit
This user-exit was introduced at FLOE version 210. Unlike the others, this user-exit is not triggered when an email is sent by Floe but rather when users reply to a Floe email and send an inbound email back to the system. In the user-exit data regarding the inbound email is available (sender, subject, body, attachments, action) as well as the id of the original outbound email. Users can use this data to process the response. More information on inbound processing can be found here.
 
 
The order the user-exits are executed in is:
  1. Email Recipient User-Exit
  2. Email Data User-Exit
  3. Email Sender User-Exit
  4. HTML Block Determination User-Exit
  5. Email Body User-Exit
  6. Image User-Exit
  7. Attachment User-Exit