Skip to content

Instantly share code, notes, and snippets.

@Saifadin
Created January 2, 2019 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Saifadin/e87d9dba1a726f1cb188171087da6ff8 to your computer and use it in GitHub Desktop.
Save Saifadin/e87d9dba1a726f1cb188171087da6ff8 to your computer and use it in GitHub Desktop.
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