Documentation / Tutorials / Awesome Enterprise

How to send email attachments in Awesome Enterprise

/ Awesome Enterprise / How to send email attachments in Awesome Enterprise

There are two methods to send email attachments in Awesome Enterprise,

1)Using a file from WordPress Media

Use this method when the email attachment is a WordPress Media post.

Usage:

When creating attachments sub array, pass the “Post Id” of required Media as file” parameter as shown in below code snippet:

[template.set_array email_data]

    [from name='{env.settings.from_email_name}' email_id='{env.settings.from_email}' /]

    [to email_id='[email protected]' /]
  
    [atts subject='test subject' message='test msg' /]

    [attachments]

      [file new]media_post_id[/file]

    [/attachments]

[/template.set_array]

 

2)Using a file from Awesome Apps folder

Use this method if the file is uploaded to the Awesome Apps folder. In this case, since the file is not uploaded into WordPress Media  Post Id is not available.

Usage:

When creating attachments sub array pass the physical file path as a parameter as shown in below code snippet:

[template.set_array email_data]

    [from name='{env.settings.from_email_name}' email_id='{env.settings.from_email}' /]

    [to email_id='[email protected]' /]

    [atts subject='test subject' message='test msg' /]

    [attachments]

      [file_path new]

       //* Path to physical File *//
       /var/www/wordpoets.com/htdocs/uploaded_file.png
  
      [/file_path]

    [/attachments]
 
[/template.set_array]

 

Categories
Most Popular