-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meta errors when rendering multiple times concurrently #91
Comments
Hello, |
@BenMansley @GemN or anyone find a solution to this? Same problem. It pretty much renders this project useless for service type activity :( |
I'm getting the same error. |
Nope. We dropped the library
…On Mon 10 Feb 2020, 18:46 Devessier, ***@***.***> wrote:
I'm getting the same error.
Has anybody found a solution or a workaround 😄 ? @BenMansley
<https://github.com/BenMansley> @GemN <https://github.com/GemN>
@robmcfeely <https://github.com/robmcfeely>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#91?email_source=notifications&email_token=AAZTJCSYPPHJGCHNOV45FNTRCGOJDA5CNFSM4G7H7LA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELJY5RI#issuecomment-584289989>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZTJCSU4EP72DRMT2UI77DRCGOJDANCNFSM4G7H7LAQ>
.
|
@robmcfeely Okay, thank your for your reply ! 👍 |
I found a workaround. Script to build: #!/bin/bash
type heml >/dev/null 2>&1 || { echo >&2 "Require heml. Please install (yarn global add heml)."; exit 1; }
for entry in "heml"/*
do
if [ -f "$entry" ];then
echo "-- Building $entry to html"
filename=${entry##*/}
heml build $entry --output html/${filename%.*}.html
fi
done Load html email: const htmlEmail = fs.readFileSync(`${__dirname}/../emails/templates/html/myemail.html`, {
encoding: 'utf-8',
}); Build the emails with dynamic variables: const htmlEmailWithValues = Mustache.render(htmlEmail, emailData);
const form = new FormData();
form.append('from', 'App <[email protected]>');
form.append('to', `${firstname} <${email}>`);
form.append('subject', subject);
form.append('html', htmlEmailWithValues); |
@GemN Great workaround ! I think I would have used your solution if I wouldn't must dynamically generate content using loops or conditions. The Gist containing the code : https://gist.github.com/Devessier/f17c3bf4e7f9a799059d1fec110ba841 |
Version: 1.1.3
Our company have recently converted all our emails to heml, and have been loving its simplicity so far. All of the emails we've sent so far have been transactional, where we've only sent them one at a time, and it's worked without a hitch. We're now implementing a monthly report for our users which will be sent out in bulk, and we're seeing errors in development.
The error trace is as follows:
This seems to be caused by
Meta
- themetaMap
Map is being flushed on the first render (this line), then thenull
Map is causing errors in subsequent renders.Is there a preferred method to handle rendering multiple emails concurrently, or is this a bug? Happy to provide any more information if required - otherwise I suppose the quickest fix for us would be to build the emails in series.
Thanks,
Ben Mansley
The text was updated successfully, but these errors were encountered: