![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
loopback-connector-postmark
Advanced tools
Strongloop Loopback connector for Postmark (email sender). Unofficial.
It uses wildbit/postmark.js under the hood. API can be found here.
npm install loopback-connector-postmark --save
datasources.json
:Configure a data source with a connector. All additional settings will go here.
"postmark": {
"name": "postmark",
"connector": "loopback-connector-postmark",
"serverToken": "xxxx-xxxxx-xxxx-xxxxx-xxxxxx",
}
:point_up: Postmark lets you send emails only if you have a server token.
Please note: You can use the datasources.ENV.js
version for configuration as well. Which sounds like quite a good idea for storing secrets:
'use strict';
module.exports = {
postmark: {
name: "postmark",
connector: "loopback-connector-postmark",
serverToken: process.env.POSTMARK_SERVER_TOKEN
}
};
model-config.json
:Bind loopback's built in Email model with the previously added data source.
"Email": {
"dataSource": "postmark",
"public": false
},
After a successful configuration, we have our postmark data source/connector bound with the Email model. So we use it as usual:
const loopback = require('loopback');
loopback.Email.send({
// Required fields
To: "to@to.com",
From: "from@from.com",
Subject: "subject",
// Optional fields
HtmlBody: "html is <strong>strong</strong>",
TextBody: "text is cool as well",
Cc: "cc@cc.com",
Bcc: "bcc@bcc.com",
ReplyTo: "reply-to@reply.com",
Tag: "tag",
TrackOpens: true,
TrackLinks: true,
Headers: {
ohMy: "header"
}
});
For fields not stated above, check Postmark's documentation. The whole object argument is just passed to the postmark client.
Some of the emails are sent by Loopback itself. Unfortunately, it's not easy to override these methods and change the way they pass arguments to the Email.send()
method.
This package tries to work around that.
If you followed Loopback's documentation about verifying users email address you probably ended up with userInstance.verify(verifyOptions)
method and verifyOptions
something as follows:
let verifyOptions = {
type: 'email',
to: userInstance.email,
from: 'noreply@loopback.com',
subject: 'Thanks for registering.',
template: path.resolve(__dirname, '../../server/views/verify.ejs'),
redirect: '/verified',
user: userInstance
};
This package lets you configure that by adding verifyUserEmail
object to postmark
configuration object stored in datasources.json
.
"postmark": {
"name": "postmark",
"connector": "loopback-connector-postmark",
"serverToken": "xxxx-xxxxx-xxxx-xxxxx-xxxxxx",
"verifyUserEmail": {
"TemplateId": "[TEMPLATE_ID]",
"name": {
"from": "user.username"
},
"product_name": "My awesome product",
"action_url": {
"from": "verifyHref"
},
"login_url": "https://myawesomeproduct.com/app/login",
"email": {
"from": "user.email"
},
"support_email": "contact@myawesomeproduct.com",
"sender_name": "John Doe",
"company_name": "Awesome Product LTD"
}
}
Provide TemplateId
you use for the confirmation email in Postmark and the variables that you specified there. If you would like to dynamically copy values from verifyOptions
, for example from user: userInstance
object, then use an object with from
property to point the path to the value you'd like to copy.
For example, if you have name
variable in your template and you passed user: userInstance
in your verification method then most probably the path to user's name is user.username
:
"name": {
"from": "user.username"
}
FAQs
Strongloop Loopback connector for Postmark (email sender)
The npm package loopback-connector-postmark receives a total of 2 weekly downloads. As such, loopback-connector-postmark popularity was classified as not popular.
We found that loopback-connector-postmark demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.