Setup email servicesDreamFactory supports a few different email providers. Crystal uses Mailgun, so we will use that as the example in this tutorial.
- Start at the ‘Services’ tab in the Admin Console
- Click on the ‘Create’ button from the left menu.
- On the service creation form, select your email provider from the ‘Service Type’ drop down box.
Select your preferred email service from the drop down.Go to the Config tab for the new service.
- Enter your Mailgun Domain and API Key.
- Click Create Service to save your new service.
- Go to the API Docs tab in the admin console to test your new service.
Insert your Mailgun domain, and API key here.
Creating custom email templatesBy using Appery.io she’s able to leverage REST endpoint mappings to send emails, using a GUI. In the screenshot below she passes in the username, email, and template name to send an email from her app. In her application, Crystal has a button that allows users to request more info about a video. In her database, she created a record that links the video to an email template. When a user ‘Requests More Info’ her app makes a DreamFactory API call that sends the email through Mailgun. By using the service mapping in Appery.io, she can integrate her mobile app to Dreamfactory in minutes.
Crystal’s email templates are stored in DreamFactory in HTML format, replacing a traditional CRM configuration.Here are the labels Crystal used to customize the email endpoints:
Email template name: ApperyIO_Quickstart Template Description: Appery.io Quickstart Guide Recipient's name: John Doe Recipient's email: [email protected] Email subject: Here’s your Appery.io Quickstart Guide Email body: Email content From name (sender name): Crystal Taggart From email (sender email): [email protected] Reply to name: Jane Doe Reply to email: [email protected] Request body:
Crystal didn’t need to code the Request Body or API endpoints — Appery.io did the mapping for her.Through a simple visual interface in Appery.io, Crystal was able to use DreamFactory to create a frictionless and powerful feature to her mobile app. You can use any number of frontend tools to do the same. That’s the power of DreamFactory’s backend solution.