Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Main email component
import React from 'react';
import { getEmail } from './utils';
/** utils.js
import { AccountUserDeleted } from './emails';
export const getEmail = name => {
switch (name) {
case 'ACCOUNT_USER_DELETED':
return AccountUserDeleted;
default:
return 2;
}
};
*/
const EmailComponent = ({ template, emailData, lang = 'en' }) => {
const Email = getEmail(template);
return <Email lang={lang} {...emailData} />;
};
export default EmailComponent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment