Configuring email provider
By default, UI Bakery On-Premise comes with a noop email provider that will only log emails to the backend logs.

Configure Sendgrid

We suggest using Sendgrid email provider to send the emails:
  1. 1.
    Create a Sendgrid account or use an existing account;
  2. 2.
    Generate an API Key with the Mail Send access enabled;
  3. 3.
    Set the following environment variables:
    1
    UI_BAKERY_MAILING_PROVIDER=sendgrid
    2
    SENDGRID_API_KEY=YOUR_API_KEY
    Copied!
  4. 4.
    Restart the containers.
Once configured, your instance will start using your account to send the user invitation, password reset, and other emails.

Change email templates

By default, email templates and subjects are provided as environment variables, so you can adjust the emails by modifying their content:
1
# tells that email will be send as plain text/html
2
UI_BAKERY_MAILING_TEMPLATES_MODE=custom
3
4
UI_BAKERY_MAILING_WELCOME_TEMPLATE=Hello userName,<br> Welcome to UI Bakery workspace.
5
UI_BAKERY_MAILING_WELCOME_SUBJECT=Welcome to UI Bakery workspace
6
7
UI_BAKERY_MAILING_RESET_PASSWORD_TEMPLATE=Hello userName,<br> Here's your <a href="resetPasswordUrl">password reset link</a>.
8
UI_BAKERY_MAILING_RESET_PASSWORD_SUBJECT=Reset password request
9
10
UI_BAKERY_MAILING_CONFIRM_EMAIL_CHANGE_TEMPLATE=Hello userName,<br> Here's a link <a href="changeEmailUrl">to change your email</a>.
11
UI_BAKERY_MAILING_CONFIRM_EMAIL_CHANGE_SUBJECT=Change email request
12
13
UI_BAKERY_MAILING_SHARE_WITH_USER_TEMPLATE=Hello userName,<br> Here's a <a href="organizationUrl">link to access the organizationName workspace</a>.
14
UI_BAKERY_MAILING_SHARE_WITH_USER_SUBJECT=You are invited to UI Bakery workspace
Copied!
You can use the following built-in email variables to add user values to your emails:
1
# All emails
2
userName, userEmail, subject, userId
3
4
# Reset password request
5
resetPasswordUrl
6
7
# Invitation email
8
organizationUrl, organizationName
9
10
# Change email request
11
changeEmailUrl
Copied!
Alternatively, you can setup email temples using Sendgrid dynamic templates and put template ids instead of plain HTML emails:
1
# tells that email will be send as using dynamic templates
2
UI_BAKERY_MAILING_TEMPLATES_MODE=provided
3
4
UI_BAKERY_MAILING_WELCOME_TEMPLATE=d-c3f84d76543941c084ff2de0exxxxxxx
5
UI_BAKERY_MAILING_RESET_PASSWORD_TEMPLATE=d-c3f84d76543941c084ff2de0exxxxxxx
6
UI_BAKERY_MAILING_CONFIRM_EMAIL_CHANGE_TEMPLATE=d-c3f84d76543941c084ff2de0exxxxxxx
7
UI_BAKERY_MAILING_SHARE_WITH_USER_TEMPLATE=d-c3f84d76543941c084ff2de0exxxxxxx
Copied!
Note, that in this case an email subject will be taken from a dynamic template configuration and variables such as UI_BAKERY_MAILING_WELCOME_SUBJECT will be ignored.
This way, you don't need to manage templates content inside of your environment variables and can build more advanced email with images and custom styles.