Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fliplet/fliplet-widget-email-provider

Email Provider
https://github.com/fliplet/fliplet-widget-email-provider

email widget

Last synced: about 5 hours ago
JSON representation

Email Provider

Awesome Lists containing this project

README

        

# Email provider

## Provider usage

```js
Fliplet.Widget.open('com.fliplet.email-provider', {
data: {
subject: 'Hello world'
}
}).then(function (result) {

});
```

## Sample result

```json
{
"subject": "Hi {{name}}",
"html": "

Hi {{name}}, how are you?

",
"to": [
{
"email": "[email protected]",
"name": "Alice"
},
{
"email": "[email protected]"
},
{
"email": "{{email}}",
"name": "{{name}}"
}
]
}
```

---

## Using the provider result

### 1. As a data source hook

```js
Fliplet.DataSources.update(1, {
hooks: [{
runOn: ["insert", "update"],
type: "email",
payload: result
}]
});
```

### 2. As a data source validation template

```js
Fliplet.DataSources.update(1, {
definition: {
validtion: {
email: {
template: result,
..,
..
}
}
}
});
```

### 3. As a template for `fliplet-communicate`

```
Fliplet.Communicate.sendEmail(result);
```