|
Name
|
Data Type
|
|---|---|
|
recordId
|
string
|
|
from
|
string
|
|
to
|
string array
|
|
cc
|
string array
|
|
bcc
|
string array
|
|
attachmentId
|
string array
|
|
templatedId
|
string
|
|
recipientId
|
string
|
|
status
|
boolean
|
|
message
|
string
|
{
"recordId" : "",
"from" : "",
"to" : [ "", "" ],
"cc" : [ "", "" ],
"bcc" : [ "", "" ],
"attachmentId" : [ "", "" ],
"templatedId" : "",
"recipientId" : ""
}
|
Attributes
|
Description
|
|---|---|
|
recordId
|
Email id to which the email needs to be sent.
|
|
from
|
Email id from which the email needs to be sent.
|
|
to
|
Email id to which the email needs to be sent.
|
|
cc
|
Email id to which the email needs to be Cc’d
|
|
bcc
|
Email id to which the email needs to be Bcc'd.
|
|
attachmentId
|
A list containing the file names of the binary and text files to be attached to the email.
|
|
templatedId
|
Template Id of the selected email Id.
|
|
recipientId*
|
Contact Reference Id which needs to be passed for the email to be sent.
|
{
"success" : true or false,
"message" : ""
}
|
Attributes
|
Description
|
|---|---|
|
success
|
If the custom function sent the email successfully, then set it to true, else false.
|
|
message
|
If the success attribute in the response is false, then this message is sent to the user.
|
Global class ClassName implements callable {
public Object call(String action, Map < String, Object > argsMap) {
switch on action {
// Assume 'sendCustomEmail' is a method name that the user has configured.
when 'sendCustomEmail' {
return sendCustomEmail(argsMap);
}
when
else {
throw new SVMXException('Method not implemented');
}
}
}
/**
* Actual implementation for sending an email.
*
* @param argMap - input data map
* {
"recordId" : "",
"from" : "",
"to" : [ "", "" ],
"cc" : [ "", "" ],
"bcc" : [ "", "" ],
"attachmentId" : [ "", "" ],
"templatedId" : "",
"recipientId" : ""
}
*
* @return Map<String, Object> - { 'success' : true/false, 'message' : 'Return message in case of error'}
*/
public Map < String, Object > sendCustomEmail(Map < String, Object > argMap) {
}
}
|
|
The Class Name and Method Name must be set to the exact name defined in the custom Apex class and method when configuring the Custom Action of type Email. For example, "Classname" and "sendCustomEmail".
|