mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Restructure codebase to use src directory
This commit is contained in:
20
src/config/sparkpost/sendEmail.ts
Normal file
20
src/config/sparkpost/sendEmail.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { SPARKPOST_SENDER_ADDRESS } from '../env';
|
||||
import client from './client';
|
||||
|
||||
interface EmailParams {
|
||||
address: string;
|
||||
text: string;
|
||||
html: string;
|
||||
subject: string;
|
||||
}
|
||||
|
||||
const sendEmail = async ({ address, text, html, subject }: EmailParams) => {
|
||||
const from = SPARKPOST_SENDER_ADDRESS;
|
||||
|
||||
await client.transmissions.send({
|
||||
content: { from, html, subject, text },
|
||||
recipients: [{ address }],
|
||||
});
|
||||
};
|
||||
|
||||
export default sendEmail;
|
||||
Reference in New Issue
Block a user