Use Email to send text or HTML messages through Mailjet, with optional CC, BCC, and file attachments.
Overview
Type: email
Mailjet credentials must be configured in the service deployment. Provide at least one of textPart or htmlPart. Sender, recipient, subject, and content fields accept Morpher templates; attachment fields do not.
Configuration
Put these fields in the step's config object. The examples below are configuration fragments; see Execute workflows for the full request format. Supply their referenced variables in context.
To
- Type: String
- Required: Yes
- Templatable: Yes
- Pattern: Valid email address format
- Description: Primary recipient email address
Code
From
- Type: String
- Required: No
- Default:
noreply@reecall.co - Templatable: Yes
- Pattern: Valid email address format
- Description: Sender email address
Code
From name
- Type: String
- Required: No
- Templatable: Yes
- Description: Display name for the sender; defaults to the sender address
Code
CC
- Type: Array of Strings
- Required: No
- Templatable: Yes
- Description: Carbon copy recipients
Code
Or use templates:
Code
BCC
- Type: Array of Strings
- Required: No
- Templatable: Yes
- Description: Blind carbon copy recipients
Code
Or use a template:
Code
Subject
- Type: String
- Required: Yes
- Templatable: Yes
- Max Length: 255 characters
- Description: Email subject line
Code
Text part
- Type: String
- Required: No (but either textPart or htmlPart is required)
- Templatable: Yes
- Multiline: Yes
- Description: Plain text version of the email content
Code
HTML part
- Type: String
- Required: No (but either textPart or htmlPart is required)
- Templatable: Yes
- Multiline: Yes
- Description: HTML version of the email content
Code
Attachments
- Type: Array of Objects
- Required: No
- Description: Files to attach to the email. Attachment fields are sent as configured and are not processed as Morpher templates.
Each attachment object contains:
filename
- Type: String
- Required: Yes
- Description: Name of the attached file
contentType
- Type: String
- Required: Yes
- Description: MIME type of the file (e.g.,
application/pdf,image/png)
base64Content
- Type: String
- Required: Yes
- Description: Base64-encoded file content
Code
Output
The Email step returns Mailjet's send response. A successful send response does not confirm delivery to the recipient's inbox.
Code
Accessing the output
Code
Examples
Simple text email
Code
HTML email with personalization
Code
Email with CC recipients
Code
Email with BCC for tracking
Code
Email with attachment
The Base64 value below is illustrative. Replace it with the complete encoded file before execution.
Code
Multi-recipient notification with both formats
Code
Dynamic sender with conditional content
Code
Error handling
Missing content and Mailjet request failures throw FLUX_EMAIL_ERROR.
Missing email content
When both textPart and htmlPart are absent or render as empty strings:
Code
Invalid request (400)
Code
Best practices
Email addresses
- Validate email addresses before sending
- Use proper email format:
name@domain.com - Consider using email verification services for user-provided addresses
Subject lines
- Keep subjects concise (50 characters or less recommended)
- Make subjects descriptive and relevant
- Personalize subjects when appropriate
- Avoid spam trigger words (FREE, WIN, URGENT in all caps)
Email content
- Provide both
textPartandhtmlPartso clients that do not display HTML can use the plain text version. - Use responsive HTML for better mobile experience
- Keep HTML simple and avoid complex CSS
- Test emails across different email clients
- Include unsubscribe links for marketing emails
Attachments
- Keep total attachment size reasonable (Mailjet limits apply)
- Use appropriate MIME types for each file format
- Common content types:
- PDF:
application/pdf - PNG:
image/png - JPEG:
image/jpeg - Word:
application/vnd.openxmlformats-officedocument.wordprocessingml.document
- PDF:
- Ensure Base64 encoding is correct
- Consider using links to large files instead of attachments
- Validate attachment content before encoding
Compliance
- For US commercial email subject to CAN-SPAM, include a valid physical postal address and a clear opt-out mechanism. See the FTC compliance guide.
- Provide clear unsubscribe mechanism
- Honor opt-out requests promptly
- Comply with CAN-SPAM, GDPR, and local regulations
- Keep records of consent for marketing communications
- Include privacy policy link when appropriate
Common use cases
- Welcome emails: Greet new users upon registration
- Order confirmations: Confirm purchases with details and receipts
- Password resets: Send secure password reset links
- Transactional notifications: Notify users of account activity
- Reports and analytics: Deliver periodic reports with attachments
- Invoices: Send billing documents to customers
- Team notifications: Alert team members of important updates
- Appointment reminders: Reduce no-shows with email reminders
- Marketing campaigns: Send newsletters and promotional content
- Account verification: Send email confirmation links
Troubleshooting
HTML not rendering
- Validate HTML syntax
- Test with simple HTML first
- Ensure both
htmlPartandtextPartare provided - Check email client compatibility
- Use inline CSS for better compatibility
Attachments not working
- Verify Base64 encoding is correct
- Check
contentTypematches the actual file type - Ensure total attachment size is within limits
- Test without attachments first to isolate issue
- Validate filename doesn't contain special characters
Invalid request errors
- Verify all required fields are provided
- Check email address format (must match pattern)
- Ensure at least one of
textPartorhtmlPartis provided - Validate template syntax in dynamic fields