@bcomeau ,
I am using parse-server-mailgun-adapter-template instead of default email adopter so that I can change passwordreset mail subject and body as I want.
When I have set Japanese characters to subject and body, sent email has 'Content-Type:text/plain; charset="ascii"' header and body&subject are unreadable characters.
My index.js code is below.
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'myAppId',
masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
fileKey: process.env.FILE_KEY || '', // Add the file key to provide access to files already hosted on Parse
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed
liveQuery: {
classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
},
verifyUserEmails: true,
emailVerifyTokenValidityDuration: 2 * 60 * 60, // in seconds (2 hours = 7200 seconds)
preventLoginWithUnverifiedEmail: false, // defaults to false
publicServerURL: process.env.SERVER_URL || 'http://localhost:1337/parse',
// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: '日本語アプリ名',
// The email adapter
emailAdapter: {
module: 'parse-server-mailgun-adapter-template',
options: {
// The address that your emails come from
fromAddress: process.env.MG_FROM_ADDRESS || '[email protected]',
// Your domain from mailgun.com
domain: process.env.MG_DOMAIN || 'example.com',
// Your API key from mailgun.com
apiKey: process.env.MG_APIKEY || 'key-mykey',
verificationSubject: process.env.MG_VERIFY_EMAIL_SUBJECT || 'メールアドレスを確認してください -',
// Verification email body
verificationBody: process.env.MG_VERIFY_EMAIL_BODY || 'Hi %username%,\n\nYou are being asked to confirm the e-mail address %email% with %appname%\n\nClick here to confirm it:\n%link%',
// Password reset email subject
passwordResetSubject: process.env.MG_PASSRESET_SUBJECT || 'パスワードリセット',
// Password reset email body
passwordResetBody: process.env.MG_PASSRESET_BODY || 'Hi %username%,\n\nYou requested a password reset for %appname%.\n\nClick here to reset it:\n%link%',
}
},
I set environment property in AWS EB about "MG_APIKEY, MG_DOMAIN, MG_FROM_ADDRESS, MG_PASSRESET_BODY, MG_PASSRESET_SUBJECT, MG_VERIFY_EMAIL_BODY, MG_VERIFY_EMAIL_SUBJECT", those body and subject parameters are in Japanese characters.
When I user default parse-server-simple-mailgun-adapter, email has 'Content-Type:text/plain; charset="utf-8"' header and I could read email normally even it has Japanese character replaced with %appname%.
Is there any way to solve this problem for example like "encording" parameter should be written in options etc.
Thank you in advance.