Appfarm Documentation
Getting startedDocumentationCommunityAppfarm Create
  • Overview
  • Getting Started
    • What is Appfarm?
    • Key concepts
    • Quickstart
      • Speed intro
      • Step-by-step guide
    • Appfarm Showroom
    • FAQ
  • Appcademy
    • Learning paths
    • Appfarm Fundamentals
      • Intro Course
        • 1. Intro to No-Code and Appfarm
        • 2. Navigation in Appfarm Create
        • 3. What is Apps?
        • 4. Intro to UI Editor
        • 5. Data Model
        • 6. App Data
        • 7. Actions
        • 8. Tips and Tricks
        • 9. Intro to practical walkthrough
        • 10. Create a details view of a Project
        • 11. Create a Custom List
        • 12. Swipe and Delete
        • 13. Functionality for simple Create of Data
        • 14. Upload and Download Photos
        • 15. Input Dialog with Validation and Save
        • 16. Dashboard
        • 17. Summary
        • Quiz
      • User Interface Fundamentals
        • Container - Sectioning, Styling and Repeating
        • Conditional Styles
        • Motions
        • Responsive Design
        • Step-by-step workflow
        • Featured UI Components
        • Quiz
      • App Data Fundamentals
        • Data Source Filtering
        • App Variables and Runtime Properties
        • URL Parameters
        • Quiz
      • Actions & Logic Fundamentals
        • Event Handlers
        • Featured Action Nodes
        • Context Parameters
        • Quiz
      • Services Fundamentals
        • Introduction to Services
        • Setting up a Service
        • Scheduling a Service
      • Integration Fundamentals
        • The web request action node
        • Fetch data from an endpoint
        • Map data to a data source
        • Modify the response
        • Nested data mapping
        • Path parameters
        • Authentication
        • Send data to an endpoint
        • Quiz
      • User handling and permissions
        • Users and roles
        • Permissions
        • Creating users
        • Extending the User object class
        • Updating and deleting users
        • Unauthenticated access
        • Quiz
    • Appfarm Professional
      • User Interfaces
        • Featured UI Components
        • Concepts and Use Cases
      • Data Structures & Data Handling
        • Data Features
        • Search & Filters
        • Featured Action Nodes
        • GraphQL
      • Logic & Flow
        • Logical Concepts
        • Date and Time Handling
        • Featured Action Nodes
        • Exception Handling
      • Login & Configuration
        • Login and Authentication
        • Settings, Configuration and Languages
      • Security & Operations
        • Security and Permissions
        • Deployment
        • Schedules and Logs
        • Debugging and App Health
      • Performance & Optimization
        • Optimizing Performance
        • Enhancing Functionality
    • Appfarm Sales Representative
    • Appfarm Developer Forum
      • Session 1: Data Modeling in Appfarm Create
      • Session 2: App Data in Appfarm Create
      • Session 3: Services in Appfarm Create
      • Session 4: Optimizing Performance
    • Background
      • Databases
        • Data modeling 101
        • Database normalization
  • Library
    • UI components
      • Advanced bar chart
      • Advanced bubble chart
      • Advanced combined chart
      • Advanced gantt chart
      • Advanced heatmap chart
      • Advanced line/area chart
      • Advanced pie chart
      • Advanced scatter plot chart
      • Advanced solid gauge chart
      • Animated component
      • Avatar
      • Avatar group
      • Basic bar chart
      • Basic gauge chart
      • Basic line chart
      • Basic pie chart
      • Bottom navigation
      • Button
      • Checkbox
      • Chip group
      • Circular progress
      • Coded component
      • Container
      • Date & time picker
      • Drawable canvas
      • Floating action button
      • Icon
      • Icon button
      • Iframe
      • Image
      • Linear progress
      • List
      • Map
      • Menu list
      • Multi select
      • PDF reader
      • Popover
      • Radio buttons
      • Rich text editor
      • Rich text
      • Select
      • Slider
      • Speed dial
      • Switch
      • Table
      • Tabs
      • Text
      • Text edit
      • View container
      • Visibility group
    • Action nodes
      • Aggregate data
      • Advanced search
      • Auth operations
      • Block
      • Catch exception
      • Copy to clipboard
      • Create file archive
      • Create file object
      • Create object
      • Create user account
      • Delete objects
      • Delete user account
      • Duplicate objects
      • End execution
      • Exit block
      • Exit loop
      • Export data
      • Foreach
      • Generate document
      • If
      • Import data
      • Invalidate cache
      • Log in
      • Log to console
      • Log out
      • Next iteration
      • Navigate
      • Open/close popover
      • Open confirm dialog
      • Open print dialog
      • Open snackbar
      • Open Unsplash dialog
      • Open URL
      • Persist objects
      • Push notifications
      • Read objects
      • Request permissions
      • Run code
      • Run other action
      • Run service
      • Scan barcode/QR code
      • Send email
      • Send SMS
      • Set client language
      • Set data source attributes
      • Set selection
      • Set theme
      • Set user account image
      • Show install app prompt
      • Sleep
      • Sort objects
      • Throw exception
      • Toggle drawer
      • Update object
      • Update secret
      • Update user account
      • Web request
      • While
  • Reference
    • Appfarm Create
      • Appfarm Commander
      • Blue dots
      • Copy & Paste
      • Farmer's Market
      • Find references
      • Find usage
      • Keyboard shortcuts
      • Undo/Redo
      • User preferences
    • Platform concepts
      • Conditions
      • Data bindings
      • Date and time
      • Event handlers
      • Filters
      • Functions
      • Markdown
      • Objects
      • Operators
      • Value processor
    • Dashboard
    • Apps
      • UI
        • Views
          • Dialog
          • Drawer
        • Layout designer
        • Component properties
        • Shareable UI components
      • Data
        • App variables
        • Data sources
        • Calendar data sources
      • Actions
      • App settings
      • App size
      • App health
    • Services
      • Service Endpoints
      • Service settings
      • Service health
      • API explorer
    • Data model
      • Object classes
      • Object class properties
      • Enumerated types
      • GraphQL
        • Queries
        • Mutations
      • Data Extract API
      • Time series data
    • Operations
      • Deploy
      • Schedules
      • Logs
    • Resources
      • Themes
      • Files
      • Fonts
      • Internationalization
    • Configuration
      • Environments
      • Login
        • Custom auth providers
    • Security
      • Users
      • Service accounts
      • Roles
      • Secrets
      • Permissions
        • Conditional Permissions
    • Appfarm Client
      • Developer tools for Apps
      • Developer tools for Services
      • Warnings and errors
  • How to
    • Data modeling
      • Many-to-many relationships
      • Use naming conventions
      • Offline data handling
      • Data silos and White labelling
    • User interface
      • Manage a many-to-many relationship with a Chip group
      • Configure drag and drop
      • Build a drag-and-drop calendar
      • Design a responsive layout
      • Work with flexbox
      • Use Mapbox as a map layer
      • Understand charts
    • Logic and flow
      • Event Log Design
      • Configure advanced search
    • Themes and styling
      • Change the active theme
      • Add custom email templates
    • Enhance your app
      • Add deep links
      • Add keyboard shortcuts
      • Add link previews for social media
      • Apply SEO best practices
      • Change the active language
      • Generate a PDF from a Container
    • Integrations
      • Integrate with external systems
      • Integrate with OpenAI
      • Integrate with Google Analytics (GA4)
      • Configure a custom email account
      • Integrate with a payment provider
      • Integrate with Signicat
      • Integrate directly with an external database
      • Retrieve a Bearer token from Google Cloud
      • Fetch data from BigQuery
      • Retrieve access token from Microsoft Entra ID
    • Workflow automation
      • Update an OAuth 2.0 access token from a service
    • Authentication and access control
      • Add users and assign roles
      • Configure unauthenticated access
      • Implement third-party authentication
    • Security, testing and deployment
      • Add a custom domain
      • Install an app on a device
      • Get ready for Production
      • Optimize performance
      • Security checklist
      • Test and debug
    • Example apps
      • Create an Instagram clone
        • The end result
        • Designing the feed
        • Create new post
        • Add a like-button
        • Add comment-functionality
  • Solution administration
    • Subscription and billing
    • Dedicated tier benefits
    • Guide to GDPR
      • Key principles
      • How Appfarm protects personal data
      • How you can protect your clients’ data
      • Glossary
    • Appfarm and the EU AI Act
  • Policies
    • Appfarm Policies
    • Data Processors
    • Privacy Policy
Powered by GitBook
On this page
  • Authentication
  • Welcome
  • Login link
  • Access code (one-time password)
  • Set password
  • Order confirmation

Was this helpful?

Export as PDF
  1. How to
  2. Themes and styling

Add custom email templates

PreviousChange the active themeNextEnhance your app

Last updated 2 years ago

Was this helpful?

Email templates are used within the action node and when customizing the default authentication emails. We have provided some example templates that leverage best practices to help you quickly start sending customized emails.

The templates are written using . MJML is a markup language and framework for easily generating responsive emails that render on most email clients. When working with MJML you need to copy the HTML generated by MJML into Appfarm Create, and not the MJML code itself.

Plain text versions of each email must also be included as a fallback option.

Email deliverability is an expansive topic that won't be explored here, but you should be familiar with some of the key principles before you begin creating your own templates or heavily modifying the examples.

Authentication

It is possible to customize the default authentication emails that are sent to users by Appfarm when they initiate a login request. The examples below are based on the default emails sent by Appfarm. These make a great starting point for customization, particularly if you simply wish to modify the text.

The parameters surrounded by {{double braces}} will be automatically populated by Appfarm when an email is sent.

Text surrounded by [[square brackets]] should be edited to suit your solution.

Welcome

The welcome email can be sent when a user is added to a solution via the Create User Account action.

.

MJML
<mjml lang="en">
  <mj-head>
    <mj-title>Welcome to [[SOLUTION NAME]]</mj-title>
    <mj-preview>Sign in to your new account.</mj-preview>
    <mj-attributes>
      <mj-all font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Oxygen,Cantarell,Fira Sans,Helvetica Neue,sans-serif" font-size="16px" line-height="1.5" color="#111827" />
    </mj-attributes>
    <mj-style>
      .button:hover a { background-color: #286db0 !important; }
    </mj-style>
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>Hi {{firstName}},</mj-text>
        <mj-text>You have been added as a user for <strong>[[SOLUTION NAME]]</strong>.
</mj-text>
        <mj-text>Click the button below to sign in.</mj-text>
        <mj-button css-class="button" background-color="#3a99f7" color="#ffffff" font-weight="600" align="left" border-radius="6px" href="{{loginLink}}">
          Sign in to [[SOLUTION NAME]]
        </mj-button>
        <mj-text>Or, copy and paste this link into your browser:<br />
          {{loginLink}}</mj-text>
        <mj-text color="#999999">This email was sent by <a href="https://appfarm.io" target="_blank" style="color: #999999;">Appfarm</a> on behalf of [[SOLUTION NAME]]. If you did not request this email, please reply and let us know.</mj-text>
      </mj-column>
    </mj-section>
    <mj-section padding-bottom="20px" padding-top="10px" background-color="#f6f6f6">
      <mj-column>
        <mj-image width="100px" src="[[SOLUTION/COMPANY LOGO]]" />
        <mj-text align="center" color="#999999" font-size="12px" line-height="1.33">[[COMPANY NAME]]<br />
          [[STREET ADDRESS]]<br />
          [[POSTCODE]] [[CITY]]<br />
          [[COUNTRY]]</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>
Plain text
Hi {{firstName}},

You have been added as a user for [[SOLUTION NAME]]. Use the following link to sign in.

{{loginLink}}

This email was sent by Appfarm on behalf of [[SOLUTION NAME]]. If you did not request this email, please let us know by replying to this email.

------

[[COMPANY NAME]]
[[STREET ADDRESS]]
[[POSTCODE]] [[CITY]]
[[COUNTRY]]

Login link

The login link email is sent when a user requests a login link to log in to an app.

MJML
<mjml lang="en">
  <mj-head>
    <mj-title>Sign in to [[SOLUTION NAME]]</mj-title>
    <mj-preview>Click this link to sign in.</mj-preview>
    <mj-attributes>
      <mj-all font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Oxygen,Cantarell,Fira Sans,Helvetica Neue,sans-serif" font-size="16px" line-height="1.5" color="#111827" />
    </mj-attributes>
    <mj-style>
      .button:hover a { background-color: #286db0 !important; }
    </mj-style>
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>Hi {{firstName}},</mj-text>
        <mj-text>Please click the button below to sign in to <strong>[[SOLUTION NAME]]</strong>. The link will expire in 5 minutes.</mj-text>
        <mj-button css-class="button" background-color="#3a99f7" color="#ffffff" font-weight="600" align="left" border-radius="6px" href="{{loginLink}}">
          Sign in to [[SOLUTION NAME]]
        </mj-button>
        <mj-text>Or, copy and paste this link into your browser:<br />
          {{loginLink}}</mj-text>
        <mj-text color="#999999">This email was sent by <a href="https://appfarm.io" target="_blank" style="color: #999999;">Appfarm</a> on behalf of [[SOLUTION NAME]]. If you did not request this email, please reply and let us know.</mj-text>
      </mj-column>
    </mj-section>
    <mj-section padding-bottom="20px" padding-top="10px" background-color="#f6f6f6">
      <mj-column>
        <mj-image width="100px" src="[[SOLUTION/COMPANY LOGO]]" />
        <mj-text align="center" color="#999999" font-size="12px" line-height="1.33">[[COMPANY NAME]]<br />
          [[STREET ADDRESS]]<br />
          [[POSTCODE]] [[CITY]]<br />
          [[COUNTRY]]</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>
Plain text
Hi {{firstName}},

Please use the following link to log in to [[SOLUTION NAME]]. The link will expire in 5 minutes.

{{loginLink}}

This email was sent by Appfarm on behalf of [[SOLUTION NAME]]. If you did not request this email, please let us know by replying to this email.

------

[[COMPANY NAME]]
[[STREET ADDRESS]]
[[POSTCODE]] [[CITY]]
[[COUNTRY]]

Access code (one-time password)

The access code (one-time password) email is sent when a user requests an access code to log in to an app.

MJML
<mjml lang="en">
  <mj-head>
    <mj-title>Sign in to [[SOLUTION NAME]]</mj-title>
    <mj-preview>Use access code {{oneTimePassword}}.</mj-preview>
    <mj-attributes>
      <mj-all font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Oxygen,Cantarell,Fira Sans,Helvetica Neue,sans-serif" font-size="16px" line-height="1.5" color="#111827" />
    </mj-attributes>
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>Hi {{firstName}},</mj-text>
        <mj-text>Please use the following access code to sign in to <strong>[[SOLUTION NAME]]</strong>. The access code will expire in 5 minutes.</mj-text>
        <mj-text color="#286db0" font-size="24px" font-weight="700" letter-spacing="2px">
        {{oneTimePassword}}
        </mj-text>
        <mj-text color="#999999">This email was sent by <a href="https://appfarm.io" target="_blank" style="color: #999999;">Appfarm</a> on behalf of [[SOLUTION/COMPANY NAME]]. If you did not request this email, please reply and let us know.</mj-text>
      </mj-column>
    </mj-section>
    <mj-section padding-bottom="20px" padding-top="10px" background-color="#f6f6f6">
      <mj-column>
        <mj-image width="100px" src="[[SOLUTION/COMPANY LOGO]]" />
        <mj-text align="center" color="#999999" font-size="12px" line-height="1.33">[[COMPANY NAME]]<br />
          [[STREET ADDRESS]]<br />
          [[POSTCODE]] [[CITY]]<br />
          [[COUNTRY]]</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>
Plain text
Hi {{firstName}},

Please use the following access code to log in to [[SOLUTION NAME]]. The access code will expire in 5 minutes.

{{oneTimePassword}}

This email was sent by Appfarm on behalf of [[SOLUTION NAME]]. If you did not request this email, please let us know by replying to this email.

------

[[COMPANY NAME]]
[[STREET ADDRESS]]
[[POSTCODE]] [[CITY]]
[[COUNTRY]]

Set password

The set password email is sent when a user requests to set or reset their password.

MJML
<mjml lang="en">
  <mj-head>
    <mj-title>Set new password for [[SOLUTION NAME]]}</mj-title>
    <mj-preview>Use this link to set a password.</mj-preview>
    <mj-attributes>
      <mj-all font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Oxygen,Cantarell,Fira Sans,Helvetica Neue,sans-serif" font-size="16px" line-height="1.5" color="#111827" />
    </mj-attributes>
    <mj-style>
      .button:hover a { background-color: #286db0 !important; }
    </mj-style>
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>Hi {{firstName}},</mj-text>
        <mj-text>We have received a request to set a new password for your <strong>[[SOLUTION NAME]]</strong> account {{email}}.
</mj-text>
        <mj-text>Please click the button below to set a new password. The link will expire in 15 minutes.</mj-text>
        <mj-button css-class="button" background-color="#3a99f7" color="#ffffff" font-weight="600" align="left" border-radius="6px" href="{{resetLink}}">
          Set password
        </mj-button>
        <mj-text>Or, copy and paste this link into your browser:<br />
          {{resetLink}}</mj-text>
        <mj-text color="#999999">This email was sent by <a href="https://appfarm.io" target="_blank" style="color: #999999;">Appfarm</a> on behalf of [[SOLUTION NAME]]. If you did not request this email, please reply and let us know.</mj-text>
      </mj-column>
    </mj-section>
    <mj-section padding-bottom="20px" padding-top="10px" background-color="#f6f6f6">
      <mj-column>
        <mj-image width="100px" src="[[SOLUTION/COMPANY LOGO]]" />
        <mj-text align="center" color="#999999" font-size="12px" line-height="1.33">[[COMPANY NAME]]<br />
          [[STREET ADDRESS]]<br />
          [[POSTCODE]] [[CITY]]<br />
          [[COUNTRY]]</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>
Plain text
Hi {{firstName}},

We have received a request to set a new password for your [[SOLUTION NAME]] account {{email}}.

Please use the following link to set a new password. The link will expire in 15 minutes.

{{resetLink}}

This email was sent by Appfarm on behalf of [[SOLUTION NAME]]. If you did not request this email, please let us know by replying to this email.

------

[[COMPANY NAME]]
[[STREET ADDRESS]]
[[POSTCODE]] [[CITY]]
[[COUNTRY]]

Order confirmation

Note: This is just a design template. If you wish to iterate over an object when the email is sent, for example to display multiple order lines, you will need to edit the generated HTML accordingly.

MJML
<mjml lang="en">
  <mj-head>
    <mj-title>Order confirmation</mj-title>
    <mj-preview>Your order #${order.orderNumber} is confirmed.</mj-preview>
    <mj-attributes>
      <mj-all font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Oxygen,Cantarell,Fira Sans,Helvetica Neue,sans-serif" font-size="16px" line-height="1.5" color="#111827" />
    </mj-attributes>
    <mj-style>
      .button:hover a { background-color: #4c1d95 !important; }
    </mj-style>
  </mj-head>
  <mj-body>
    <mj-section padding-bottom="0px">
      <mj-column>
        <mj-text>Hi ${firstName},</mj-text>
        <mj-text>Your order is confirmed. Please find a summary of your order below.</mj-text>
        <mj-text align="center" font-size="20px" font-weight="600" padding-top="24px">
          Order #${order.orderNumber}
        </mj-text>
      </mj-column>
    </mj-section>

    <mj-section padding-top="0px" padding-bottom="0px">
      <mj-column>
        <mj-text><span style="font-weight: 600;">${customer.name}</span><br />
          ${customer.street}<br />
          ${customer.postcode} ${customer.city}<br />
          ${customer.country}</mj-text>
      </mj-column>

      <mj-column>
        <mj-text><span style="font-weight: 600;">Order received:</span> ${order.orderDate}<br />
          <span style="font-weight: 600;">Payment type:</span> ${order.paymentType}<br />
          <span style="font-weight: 600;">Terms:</span> ${order.paymentTerms}
        </mj-text>
      </mj-column>
    </mj-section>

    <mj-section>
      <mj-column>
        <mj-table>
          <tr style="border-bottom:1px solid #ecedee;text-align:left;padding:15px 0;">
            <th style="padding: 0 15px 0 0;">Serial #</th>
            <th style="padding: 0 15px;">Quantity</th>
            <th style="padding: 0 15px;">Product</th>
            <th style="padding: 0 0 0 15px;">Price</th>
          </tr>
          <tr>
            <td style="padding: 0 15px 0 0;">${orderLine.serialNumber}</td>
            <td style="padding: 0 15px;">${orderLine.quantity}</td>
            <td style="padding: 0 15px;">${orderLine.productName}</td>
            <td style="padding: 0 0 0 15px;">${orderLine.price}</td>
          </tr>
          <tr>
            <td colspan="3" align="right" style="padding: 20px 0 0 0; font-weight: 600;">Total</td>
            <td style="padding: 20px 0 0 15px;">${total}</td>
          </tr>
        </mj-table>
      </mj-column>
    </mj-section>

    <mj-section padding-top="0px">
      <mj-column>
        <mj-button css-class="button" background-color="#6d28d9" color="#ffffff" font-weight="600" align="center" border-radius="6px" href="https://${hostname}/orders/status?id=${order.randomIdentifier}">
          Check order status
        </mj-button>
      </mj-column>
    </mj-section>

    <mj-section padding-bottom="20px" padding-top="20px" background-color="#f5f3ff">
      <mj-column>
        <mj-image width="100px" src="https://storage.googleapis.com/appfarm-public/618bb78c8c37aa821c22194b/Lh5YR6lEWw" />
        <mj-text align="center" color="#111827" font-size="12px" line-height="1.33">Appfarm AS<br />
          Universitetsgata 2<br />
          0164 Oslo<br />
          Norway</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

.

.

.

This generic order confirmation is an example of an email that can be customized for use in the action node.

.

Send Email
MJML
Open template on mjml.io to edit and view HTML
Open template on mjml.io to edit and view HTML
Open template on mjml.io to edit and view HTML
Open template on mjml.io to edit and view HTML
Send Email
Open template on mjml.io to edit and view HTML