Definition 

niemail://path_to_configuration_file

"Copyright (c) 2018 The Interact Technology Group. THE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. All rights reserved."

 

Usage

Configure emails’ content, look and attachments. Email configuration file sample:


Simple - this example will leave the Email To option blank to be populated by what the user decides. The Email From will be populated by the users email:

{
  "type":"ecfg",
  "version":"1",  
  "email_subject" : "SmartPDF Tags",
  "email_body" : "",
  "email_body_file" : "email/attachments/body.html",
  "email_attachments" : [    
    {
      "path" : "email/attachments/INTERACT - Glossary.pdf",
      "mime_type" : "application/pdf"
    }    
  ]
}
"_comment": "Copyright (c) 2018 The Interact Technology Group. THE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. All rights reserved.",



Advanced: 

{
 "type": "ecfg",
 "version": "1",
 "email_to": "user@home.com",
 "email_cc": ["another@home.com", "another2@home.com"],
 "email_bcc": "thirduser@home.com",
 "email_subject": "Email Subject",
 "email_body_file": "attachments/email_body.html",
 "email_attachments": [{
   "path": "attachments/attachment.pdf",
   "mime_type": "application/pdf"
   }, {
   "path": "attachments/image.jpg",
   "mime_type": "image/jpg"
 }]
}

"_comment": "Copyright (c) 2018 The Interact Technology Group. THE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. All rights reserved.",

 

Samples 

niemail://my_email.config
niemail://emails/my_email_product_info.config

"Copyright (c) 2018 The Interact Technology Group. THE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. All rights reserved."

 

Notes

  • In the sample above “email_body_file” is used in precedence to “email_body”. Thus “email_body_file” can be left out.
  • If “email_body_file” has a supplied path, the contents of the file will be used as the HTML body of the email.
  • Email attachments are specified as an array, so one or more attachments can be added. Zero attachments is also supported.