EmailApi (Email APIs)

sendEmail

Send email to recipient via the internally provision gateway of the workbench.​

EmailApi.sendEmail(String appName, String email, String subject, String content,
      String template, String fromAlias, Map<String, Object> templateParams)
or

EmailApi.sendEmail(String appName, String email, String subject, String content,
      String template, String fromAlias, Map<String, Object> templateParams, String senderEmail)
or
EmailApi.sendEmail(final String toEmail, final String subject, String content)
or 
EmailApi.sendEmail(final String toEmail, final String template,
      final Map<String, Object> emailParams, final String subject)

parameters:

appName:     name of the internal application
email:       email of the sender
subject:     subject of a email
content:     contents
template:    template to be used 
fromAlias:   alias name  
templateParams:   template parameters
senderEmail:      sender email
toEmail:     to email
emailParams : email params

Return:

result of the operation​

sendEmailMarkDownContent

Send email with markdown contents.

EmailApi.sendEmailMarkDownContent(String mailTo, String body, String subject)

parameters:

mailTo:    recipient address
body:      body with markdown
subject:   subject of the email

Return:

result of the operation​

sendEmailUsingFunction

Send email using the function

EmailApi.sendEmailUsingFunction(String functionName,
      Map<String, Object> emailParams)

parameters:

functionName
emailParams

Return:

boolean

getSubject

Get subject

EmailApi.getSubject(String templateName, String defaultSubject,
      Map<String, Object> emailParams)

parameters:

templateName
defaultSubject
emailParams

Return:

String

getProcessedEmailContentFromTemplate

get processed email content from template

EmailApi.getProcessedEmailContentFromTemplate(String templateName,
      Map<String, Object> emailParams)

parameters:

templateName
emailParams

Return:

String

emailTemplateExists

check if the email template exits

EmailApi.emailTemplateExists(String templateName)

parameters:

templateName

Return:

boolean

getEmailProps

get email props

EmailApi.getEmailProps(String templateName)

parameters:

templateName

Return:

Map<String, Object>

getServerName

get server name

EmailApi.getServerName()

parameters:

None

Return:

String

Last updated