Created
January 2, 2019 10:28
-
-
Save Saifadin/e87d9dba1a726f1cb188171087da6ff8 to your computer and use it in GitHub Desktop.
Main email component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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