Emails
Updated on Aug 21, 2023 2 minutes to readTo utilize the methods offered by this plugin, you should call them through the E8App.$emails object.
Create
Syntax:
E8App.$emails.create(<config>, <scriptAlias>, <objectId>)
Description:
Opens a message form with filled values.
Parameters:
<config> - required
Type: Object
Email creation parameters
{ accountId: <number> email account available for current user account,attachments: <string[ ]> a file/files should be attached to the email,
body: <string> email message body,
bcc: <string | string[ ]> email’s blind carbon copy (all the recipients will be able to see each other email address),
cc: <string | string[ ]> email’s carbon copy (recipients will not be able to see each other email address),
signatureId: <number> email profile signature Id,
subject: <string> email subject,
to: <string> recipient’s email address }
<scriptAlias> - required
Type: String
Script alias of a list object to which the email message will be attached.
Returned value:
The promise resolves to void.
E8App.$emails.create( {accountId: defaultAccount, to: 'email@email.com', subject: 'Business', body: 'Hello...', attachments: []}, 'lstInvoices', 1);
Get email profiles
Syntax:
E8App.$emails.getAccounts()
Description:
Gets email profiles available for current user account.
Returned value:
The promise resolves to the email accounts array.
Type: Object.
{ Id: <string> email profile Id,name: <string[ ]> email profile name,
text: <string> email profile name,
private: <boolean> indicates if the email profile is private (available only current user),
default: <boolean> indicates if the email profile is set as default,
signature: <number> email profile signature number }
E8App.$emails.getAccounts();
Get the default email profile
Syntax:
E8App.$emails.getDefaultAccount()
Description:
Gets an email profile set as the default for current user account.
Returned value:
The promise resolves and produces the object representing the default email account parameters.
Type: Object.
{ id: <string> email profile Id,name: <string> email profile name,
text: <string> email profile name,
private: <boolean> indicates if the email profile is private (available only current user),
default: <boolean> indicates if the email profile is set as default,
signature: <object> email profile signature parameters }
E8App.$emails.getDefaultAccount();
Get signatures
Syntax:
E8App.$emails.getSignatures()
Description:
Gets email profile signatures available for current user account.
Returned value:
The promise resolves to the email signatures parameters array.
Type: Object.
{ id: <number> signature Id,name: <string> signature name,
text: <string> signature name,
signature: <string> signature content }
E8App.$emails.getSignatures();
Get email templates
Syntax:
E8App.$emails.getTemplates()
Description:
Gets email templates available for current user account.
Returned value:
Gets email templates available for current user account.
Type: Object.
{ id: <number> email template Id,name: <string> template name,
subject: <string> email template subject,
text: <string> template name,
template: <string> template content }
E8App.$emails.getTemplates();
Send
Syntax:
E8App.$emails.send(<config>, <scriptAlias>, <objectId>)
Description:
Creates and sends an email message using config parameters. Sent message is attached to the list object using script alias and object id.
Parameters:
<config> - required
Type: Object
Parameters of creating an email message.
{ accountId: <number> email account Id available for current user account,attachments: <string[ ]> a file/files should be attached to the email,
body: <string> email message body,
cc: <string | string[ ]> email’s carbon copy (all the recipients will be able to see each other email address),
bcc: <string | string[ ]> email’s blind carbon copy (recipients will not be able to see each other email address),
signatureId: <number> email profile signature Id,
subject: <string> email subject,
to: <string> recipient’s email address }
<scriptAlias> - required
Type: String
Script alias of a list object to which the email message will be attached.
Returned value:
The promise resolves to void.
E8App.$emails.create( {accountId: defaultAccount, to: 'email@email.com', subject: 'Business', body: 'Hello...', attachments: []}, 'lstGoods', 2);