- In this guide, we assume you have basic knowledge of Logto Connectors. If you don't, check out the Configure connectors guide to get started.
Aliyun direct mail connector
The official Logto connector for Aliyun connector for direct mail service.
阿里云邮件推送服务 Logto 官方连接器 中文文档
Table of contents
Get started
Aliyun is a primary cloud service provider in Asia, offering many cloud services, including DM (direct mail). Aliyun DM Connector is a plugin provided by the Logto team to call the Aliyun DM service APIs, with the help of which Logto end-users can register and sign in to their Logto account via mail verification code (or in other words, verification code).
Set up an email service in Aliyun DirectMail Console
💡 Tip
You can skip some sections if you have already finished.
Create an Aliyun account
Head to Aliyun and create your Aliyun account if you don't have one.
Enable and configure Aliyun Direct Mail
Go to the DM service console page and sign in. Enable the Direct Mail service by clicking the "Apply to enable" (申请开通) button on the top left of the page and begin the configuration process.
Starting from the DM admin console page, you should:
- Go to "Email Domains" (发信域名) from the sidebar and add "New Domain" (新建域名) following the instructions.
- Customize "Sender Addresses" (发信地址) and "Email Tags" (邮件标签) respectively.
After finishing setup, there are two different ways to test:
- Go to the DirectMail Overview page, find "Operation Guide" (操作引导) at the bottom of the page, and click on "Send Emails" (发送邮件). You will find all the different kinds of testing methods.
- Follow the path "Send Emails" (发送邮件) -> "Email Tasks" (发送邮件) in the sidebar to create a testing task.
Compose the connector JSON
- From the DM admin console page, hover on your avatar in the top right corner and go to "AccessKey Management" (AccessKey 管理), and click "Create AccessKey" (创建 AccessKey). You will get an "AccessKey ID" and "AccessKey Secret" pair after finishing security verification. Please keep them properly.
- Go to the "Sender Addresses" (发信地址) or "Email Tags" (邮件标签) tab you just visited from the DM admin console page, you can find Sender Address or Email Tag easily.
- Fill out the Aliyun DM Connector settings:
- Fill out the
accessKeyId
andaccessKeySecret
fields with access key pairs you've got from step 1. - Fill out the
accountName
andfromAlias
field with "Sender Address" and "Email Tag" which were found in step 2. All templates will share this signature name. (You can leavefromAlias
blank as it is OPTIONAL.) - You can add multiple DM connector templates for different cases. Here is an example of adding a single template:
- Fill out the
subject
field, which will work as title of the sending email. - Fill out the
content
field with arbitrary string-type contents. Do not forget to leave{{code}}
placeholder for random verification code. - Fill out
usageType
field with eitherRegister
,SignIn
,ForgotPassword
orGeneric
for different use cases. (usageType
is a Logto property to identify the proper use case.) In order to enable full user flows, templates with usageTypeRegister
,SignIn
,ForgotPassword
andGeneric
are required.
- Fill out the
- Fill out the
Test Aliyun DM connector
You can type in an email address and click on "Send" to see whether the settings can work before "Save and Done".
That's it. Don't forget to Enable connector in sign-in experience.
Config types
Name | Type |
---|---|
accessKeyId | string |
accessKeySecret | string |
accountName | string |
fromAlias | string (OPTIONAL) |
templates | Template[] |
Template Properties | Type | Enum values |
---|---|---|
subject | string | N/A |
content | string | N/A |
usageType | enum string | 'Register' | 'SignIn' | 'ForgotPassword' | 'Generic' |
阿里云邮件连接器
开始上手
阿里云是亚洲地区一个重要的云服务厂商,提供了包括邮件服务在内的诸多云服务。
本连接器是 Logto 官方提供的阿里云邮件连接器,帮助终端用户通过邮件验证码进行登录注册。