Emailing from an app using MDrivenServer
(Created page with "If you have an action in your viewmodel named “email” then MDrivenServer will try to find the following properties in your viewmodel: '''to''' : will be used as to email...") |
No edit summary |
||
Line 1: | Line 1: | ||
Be sure to have set up the [[Turnkey email settings|portal settings]] or [[Fill in the email settings in the admin UI|MDriven Server settings]] | |||
=== Serverside viewmodel === | |||
Create a [[MDrivenServer periodic server-side actions|serverside]] viewmodel like this; | |||
[[File:Example of viewmodel for emailing.png|frameless|509x509px]] | |||
''' | When you have an action in your viewmodel named “email” then MDrivenServer will try to find the following properties in your viewmodel: | ||
* '''to''' : will be used as to email address. You can also send in multiple emails in a comma separated string to send to multiple. Use this syntax PopularName<email> to get a common name to show instead of the email. For example "PopularName1<email@email.x>,PopularName2<email2@email.x>" | |||
''' | * '''from:''' the sender email | ||
''' | * '''frompresentation''': the name to use as sender | ||
''' | * '''body:''' the message | ||
''' | * '''subject''': the subject line | ||
'' | * '''Emailxxx''': Any action starting with email will trigger the send. | ||
====Adding attachments to server side emails==== | |||
Add a nesting column name "attachments" | |||
Let the target nesting have the following columns: file:blob, name:string and mediatype:string | |||
None of the above is case sensitive. See example below | |||
[[File:AttatchExample.JPG|link=https://wiki.mdriven.net/index.php/File:AttatchExample.JPG]] |
Revision as of 10:57, 16 August 2019
Be sure to have set up the portal settings or MDriven Server settings
Serverside viewmodel
Create a serverside viewmodel like this;
When you have an action in your viewmodel named “email” then MDrivenServer will try to find the following properties in your viewmodel:
- to : will be used as to email address. You can also send in multiple emails in a comma separated string to send to multiple. Use this syntax PopularName<email> to get a common name to show instead of the email. For example "PopularName1<email@email.x>,PopularName2<email2@email.x>"
- from: the sender email
- frompresentation: the name to use as sender
- body: the message
- subject: the subject line
- Emailxxx: Any action starting with email will trigger the send.
Adding attachments to server side emails
Add a nesting column name "attachments"
Let the target nesting have the following columns: file:blob, name:string and mediatype:string
None of the above is case sensitive. See example below
This page was edited more than 11 months ago on 02/10/2024. What links here