# EmailApi (Email APIs)

## sendEmail

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

```
EmailApi.sendEmail(appName, email, subject, content,
      template, fromAlias, templateParams)
or

EmailApi.sendEmail(appName, email, subject, content,
      template, fromAlias, templateParams, senderEmail)
or
EmailApi.sendEmail(toEmail, subject, content)
or 
EmailApi.sendEmail(toEmail, template,
      emailParams, subject)
```

parameters:

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

Return:

```
A Result object indicating the success or failure of the email sending operation.
```

## sendEmailMarkDownContent

Send email with markdown contents.

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

parameters:

```
mailTo:    recipient address (string)
body:      body with markdown (string)
subject:   subject of the email (string)
```

Return:

```
A Result object indicating the success or failure of the email sending operation.
```

## sendEmailUsingFunction

Send email using the function

```
EmailApi.sendEmailUsingFunction(functionName,
      emailParams)
```

parameters:

```
functionName (string)
emailParams (dictionary)
```

Return:

```
boolean
```

## getSubject

Get subject

```
EmailApi.getSubject(templateName, defaultSubject,
      emailParams)
```

parameters:

```
templateName (string)
defaultSubject (string)
emailParams (dictionary)
```

Return:

```
String
```

## getProcessedEmailContentFromTemplate

get processed email content from template

```
EmailApi.getProcessedEmailContentFromTemplate(templateName,
      emailParams)
```

parameters:

```
templateName (string)
emailParams (dictionary)
```

Return:

```
String
```

## emailTemplateExists

check if the email template exits

```
EmailApi.emailTemplateExists(templateName)
```

parameters:

```
templateName (string)
```

Return:

```
boolean
```

## getEmailProps

get email props

```
EmailApi.getEmailProps(templateName)
```

parameters:

```
templateName (string)
```

Return:

```
Dictionary
```

## 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-python-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.
