On A.10.51 Email Templates, create an email template for the custom email for requisition feature. This email template works with keywords and must have a predefined base structure for this feature to work properly. Verify that the ZIP Attachments check box is marked.
Email body creation:
Define a function in M_PCK_EMAIL_CUSTOM to fill the email body. An example function, called EMAIL_EXAMPLE, is available.
The function must have exactly these parameters and always return a number value:
FUNCTION email_example
( p_r_id IN m_reqs.r_id%TYPE,
p_emt_id IN M_EMAIL_TEMPLATES.EMT_ID%TYPE,
p_test IN VARCHAR2 DEFAULT 'N',
p_email IN VARCHAR2 DEFAULT 'N',
p_zip IN VARCHAR2 DEFAULT 'N')
RETURN NUMBER;
Some parts of the code can be modified; others must be available in your own created functions. The code that is required for all functions to fill email bodies is commented in the example function M_PCK_EMAIL_CUSTOM.email_example.
To use this defined function in an email body, you must enter the keyword EMAIL=M_PCK_EMAIL_CUSTOM.your_function;
You must type it in uppercase, and it must end with a semicolon (;).
If you have marked the ZIP Attachments indicator, then you can insert the keywords with all available defined functions via LOV.
Attachment creation:
To attach files to an email, you can create your own reports. These reports must be available in your report directory.
Define a function in M_PCK_EMAIL_CUSTOM to return the report name of that report you want to use to create the attachments. Four example functions, called REPORT_EXAMPLE – REPORT_EXAMPLE4, are available.
The function must have exactly these parameters and always return a VARCAHR2 value:
FUNCTION report_example
( p_r_id IN m_reqs.r_id%TYPE)
RETURN VARCHAR2;
To use this defined function in an email body, you must enter the keyword REPORT=M_PCK_EMAIL_CUSTOM.your_function;
You must type it in uppercase, and it must end with a semicolon (;).
If you have marked the ZIP Attachments indicator, you can insert the keywords with all available defined functions via LOV.