# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trillo.gitbook.io/trillo-workbench-java-sdk/json-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
