clevertech / email-service Goto Github PK
View Code? Open in Web Editor NEWEmail microservice that sends emails based on templates
Email microservice that sends emails based on templates
Hi,
I have an issue with the configuration as an express router. I have all configurations in .env file but when I start the router I have following message:
error: No valid TRANSPORT set
error: TypeError: Cannot set property 'mailer' of undefined
It seems as it can't read configuration.
These are my env variables:
AWS_KEY=''
AWS_SECRET='********'
AWS_REGION=''
TEMPLATES_DIR='/my/local/path'
TRANSPORT='ses'
DEFAULT_FROM='[email protected]'
DEFAULT_LANGUAGE='en'
And this is my code to start the service:
import emailService from 'pnp-email-service';
export default function (app) {
const router = emailService.createRouter();
app.use('/api/email', router);
return router;
}
Thank you
Alessia
When writing the clients for my email-service there are certain ejs
template values I would like to include at the service level instead of at the client level. The main example I have right now is the hostname that the emails should link to. For example, a password reset email should link to different hostnames according to environment: localhost
for dev, servicename:port
for staging, productionhost.com
for prod. Across my different environments I want to be able to include these values within the config or as part of a separate API call to the email-service.
Going to take a crack at this now for my project and will post a PR back if this is something you folks would like to roll in.
The current error response from email-service is to include the error message in a json payload under the key error
. This is useful for development, but for more advanced purposes it would be ideal to allow for customization of this error response. Specifically, the company I am working for has standardized an error response from our APIs that I'd like our running version of email-service to conform to.
I'm going to fork and put together a working example, but want to raise this issue so I can get feedback if there is a particular way you folks would like this done.
Thanks for the great service! Will report back with a PR within the next week or so.
Hello, what if the email contain attachments? Not static files. In that case, how do you pass multiple files to this service?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.