mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
Don't forget to await!
This commit is contained in:
parent
ef2bed1902
commit
0fb9771376
2 changed files with 4 additions and 4 deletions
|
@ -44,8 +44,8 @@ const LimitedString = ({ string }) =>
|
|||
</div>
|
||||
|
||||
export const getFieldValue = (value, typeName) => {
|
||||
|
||||
if (typeof value === 'undefined') {
|
||||
|
||||
if (typeof value === 'undefined' || value === null) {
|
||||
return ''
|
||||
}
|
||||
|
||||
|
|
|
@ -121,6 +121,7 @@ VulcanEmail.build = async ({ emailName, variables }) => {
|
|||
const data = email.data ? {...result.data, ...email.data(variables)} : result.data;
|
||||
|
||||
const subject = typeof email.subject === 'function' ? email.subject(data) : email.subject;
|
||||
|
||||
const html = VulcanEmail.buildTemplate(VulcanEmail.getTemplate(email.template)(data));
|
||||
|
||||
return { data, subject, html };
|
||||
|
@ -128,8 +129,7 @@ VulcanEmail.build = async ({ emailName, variables }) => {
|
|||
|
||||
VulcanEmail.buildAndSend = async ({ to, emailName, variables }) => {
|
||||
|
||||
const email = VulcanEmail.build({ to, emailName, variables });
|
||||
|
||||
const email = await VulcanEmail.build({ to, emailName, variables });
|
||||
return VulcanEmail.send(to, email.subject, email.html);
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue