Description
The createButton
function allows you to create an interactive button that, when clicked, opens a predefined email. This is achieved by using the OpenMail
function within the button. The email can automatically generate recipients, subject lines, and content from project data.
Syntax
createButton( state, buttonText, tooltip, OpenMail(to, cc, bcc, subject, body, sendLater), ...other parameters )
Arguments
Argument | Description |
---|---|
state |
Determines whether the button is active (1 ) or disabled (0 ). A disabled button cannot be clicked and appears grayed out for the user. |
to |
The email address of the recipient. |
cc |
Optional CC recipients. |
bcc |
Optional BCC recipients. |
subject |
The subject of the email. This can be dynamically filled with project data. |
body |
The body content of the email. This can also be dynamically populated. |
sendLater |
Determines whether the email is sent immediately (0 ) or only opened for manual sending (1 ). |
Return Types
The createButton
function creates an interactive button. The OpenMail
function inside the button opens a predefined email in the user's email client.
Examples
Description | Formula |
---|---|
Simple email creation |
createButton( 1, "Create Email", "Tooltip", OpenMail( "colleagues@example.com", "", "", "Project Info for " + projectTitle, "Dear colleagues,\n\n" + "The project " + projectTitle + " requires your attention.\n" + "Please review the information at the following link:\n" + "https://example.com/project/" + shortenGUID(projectGuid) + "\n\n" + "Thank you,\n" + getUserName(), 1 ), "", "", "", "Email successfully created", "", "envelope" ) |
Email with dynamic data |
createButton( 1, "Create Email", "Tooltip", OpenMail( flavor("Distribution List"), "", "", "Important Information about " + projectFlavor("Main Title"), "Dear colleagues,\n\n" + "Here are the details for the project:\n" + "Title: " + projectFlavor("Main Title") + "\n" + "PD-ID: " + projectId + "\n" + "Cost Center: " + projectFlavor("Cost Center") + "\n\n" + "For more details, please visit the following link:\n" + "https://example.com/project/" + shortenGUID(projectGuid) + "\n\n" + "Best regards,\n" + getUserName(), 1 ), "", "", "", "Email successfully created", "", "envelope" ) |
Notes
- Personalized Emails: Use dynamic data such as
projectTitle
orflavor("Field Name")
to customize email content. - Testing: Ensure all used fields and flavors exist in the project to avoid errors.
- Confidential Data: Be cautious not to include sensitive data unintentionally in emails.
Comments
0 comments
Please sign in to leave a comment.