|
3 | 3 | */
|
4 | 4 | import 'dotenv/config';
|
5 | 5 | import SGmail, { MailDataRequired } from '@sendgrid/mail';
|
| 6 | +// @ts-ignore |
| 7 | +import footnote from '../../photos/email_footnote.txt'; |
6 | 8 |
|
7 | 9 | const appName = 'Boilerplate'; // Replace with a relevant project name
|
8 | 10 | const senderName = 'Hack4Impact UPenn'; // Replace with a relevant project sender
|
@@ -128,10 +130,172 @@ const emailRequestDelete = async (email: string, childName: string) => {
|
128 | 130 | await SGmail.send(mailSettings);
|
129 | 131 | };
|
130 | 132 |
|
| 133 | +const emailRequestCreate = async (email: string, childName: string) => { |
| 134 | + const mailSettings: MailDataRequired = { |
| 135 | + from: { |
| 136 | + email: process.env.SENDGRID_EMAIL_ADDRESS || '[email protected]', |
| 137 | + name: 'Box of Balloons, Inc.', |
| 138 | + }, |
| 139 | + to: email, |
| 140 | + subject: 'Box of Balloons Request Received!', |
| 141 | + html: ` |
| 142 | + <p>Hello,</p> |
| 143 | + |
| 144 | + <p>Thank you for your request. Box of Balloons has received your request and you will receive a |
| 145 | + response when your request is either approved or denied by your local chapter leader.</p> |
| 146 | + |
| 147 | + <p>If you have any specific questions in the meantime, please reach out to your local chapter by |
| 148 | + finding their contact information <a href="https://www.boxofballoons.org/where-are-we-1">here</a>.</p> |
| 149 | + |
| 150 | + <p>We appreciate your patience as all our chapters are run 100% by volunteers so response time, |
| 151 | + while often quick, may sometimes be delayed.</p> |
| 152 | + |
| 153 | + <p>Thank you,</p> |
| 154 | + |
| 155 | + <p>Box of Balloons, Inc. - Automated response</p> |
| 156 | + `, |
| 157 | + }; |
| 158 | + |
| 159 | + //<img src='data:image/png;base64,${footnote}' alt="Box of Balloons Logo" style="max-width: 100%; height: auto;"/> |
| 160 | + |
| 161 | + // Send the email and propagate the error up if one exists |
| 162 | + await SGmail.send(mailSettings); |
| 163 | +}; |
| 164 | + |
| 165 | +const emailRequestApproved = async (email: string, childName: string) => { |
| 166 | + const mailSettings: MailDataRequired = { |
| 167 | + from: { |
| 168 | + email: process.env.SENDGRID_EMAIL_ADDRESS || '[email protected]', |
| 169 | + name: 'Box of Balloons, Inc.', |
| 170 | + }, |
| 171 | + to: email, |
| 172 | + subject: 'Box of Balloons Request Approved!', |
| 173 | + html: ` |
| 174 | + <p>Hello,</p> |
| 175 | + |
| 176 | + <p>Congratulations, let the celebrations begin!! Your request for a birthday box has |
| 177 | + been approved by your local volunteer-led chapter of Box of Balloons, Inc.</p> |
| 178 | + |
| 179 | + <p>Please watch out for an email or phone call from your local volunteer chapter |
| 180 | + leader with instructions on how your box will be delivered.</p> |
| 181 | + |
| 182 | + <p>If you have any specific questions in the meantime, please reach out to your local chapter by |
| 183 | + finding their contact information <a href="https://www.boxofballoons.org/where-are-we-1">here</a>.</p> |
| 184 | + |
| 185 | + <p>Thank you,</p> |
| 186 | + |
| 187 | + <p>Box of Balloons, Inc. - Automated response</p> |
| 188 | + `, |
| 189 | + }; |
| 190 | + await SGmail.send(mailSettings); |
| 191 | +}; |
| 192 | + |
| 193 | +const emailRequestDenied = async (email: string, childName: string) => { |
| 194 | + const mailSettings: MailDataRequired = { |
| 195 | + from: { |
| 196 | + email: process.env.SENDGRID_EMAIL_ADDRESS || '[email protected]', |
| 197 | + name: 'Box of Balloons, Inc.', |
| 198 | + }, |
| 199 | + to: email, |
| 200 | + subject: 'Box of Balloons Request Denied', |
| 201 | + html: ` |
| 202 | + <p>Hello,</p> |
| 203 | + |
| 204 | + <p>Thank you for your request. Unfortunately, your local chapter is unable to fulfill your request |
| 205 | + for a birthday box at this time.</p> |
| 206 | + |
| 207 | + <p>As an organization run 100% by volunteers, our ability to accept every request submitted is sometimes |
| 208 | + limited by availability and we apologize for the inconvenience this may cause to the families you serve.</p> |
| 209 | + |
| 210 | + <p>We encourage you to reach out to your chapter leaders to explore future opportunities by emailing them |
| 211 | + directly. You may find their contact information <a href="https://www.boxofballoons.org/where-are-we-1">here</a>.</p> |
| 212 | + |
| 213 | + <p>Regretfully,</p> |
| 214 | + |
| 215 | + <p>Box of Balloons, Inc. - Automated response</p> |
| 216 | + `, |
| 217 | + }; |
| 218 | + await SGmail.send(mailSettings); |
| 219 | +}; |
| 220 | + |
| 221 | +const emailRequestDelivered = async (email: string, childName: string) => { |
| 222 | + const mailSettings: MailDataRequired = { |
| 223 | + from: { |
| 224 | + email: process.env.SENDGRID_EMAIL_ADDRESS || '[email protected]', |
| 225 | + name: 'Box of Balloons, Inc.', |
| 226 | + }, |
| 227 | + to: email, |
| 228 | + subject: 'Box of Balloons Request Delivered!', |
| 229 | + html: ` |
| 230 | + <p>Cue the Confetti!</p> |
| 231 | + |
| 232 | + <p>The box you have requested on behalf of the families you serve has been delivered! Our goal is to |
| 233 | + ensure every child feels celebrated on their birthday and we are so thrilled to be able to provide our |
| 234 | + services to the families your agency helps.</p> |
| 235 | + |
| 236 | + <p>As an organization run mostly by volunteers, while our overhead is small compared to other larger |
| 237 | + nonprofits, we still have overhead to cover the costs of running a nonprofit. To help us ensure each |
| 238 | + birthday is happy and every child is celebrated we invite you to consider helping us spread more joy |
| 239 | + to organizations like yours and the families you serve.</p> |
| 240 | + |
| 241 | + <p>Please consider making a donation today, no amount is too small - <a href="https://boxofballoons.networkforgood.com/">Donate Now</a></p> |
| 242 | + |
| 243 | + <p>Other ways to contribute to our mission is by encouraging the family we provided a birthday box to, to send us an email or write a letter |
| 244 | + sharing how impactful our service was to them and their child/children. Letters, thank you cards, and especially pictures can be a catalyst |
| 245 | + in supporting our mission.</p> |
| 246 | + |
| 247 | + <p>If it is safe to do so and the family assisted is comfortable doing so, we ask that these small but large displays of gratitude be emailed |
| 248 | + to: <a href="[email protected]">[email protected]</a> or mailed to P.O. Box 28, Sun Prairie WI. 53590.</p> |
| 249 | +
|
| 250 | + <p>Please note any pictures received will be used to advance our fundraising efforts, if a child's identity needs to be hidden please note so |
| 251 | + in the email or letter and an emoji will be used to protect the family and child/ren served.</p> |
| 252 | +
|
| 253 | + <p>Thank you again for everything you do to make our community a better place for children and families in need. We are in this together!</p> |
| 254 | +
|
| 255 | + <p>Here to serve,</p> |
| 256 | +
|
| 257 | + <p>Box of Balloons, Inc. Volunteer Team</p> |
| 258 | + `, |
| 259 | + }; |
| 260 | + |
| 261 | + //<img src='data:image/png;base64,${footnote}' alt="Box of Balloons Logo" style="max-width: 100%; height: auto;"/> |
| 262 | + |
| 263 | + // Send the email and propagate the error up if one exists |
| 264 | + await SGmail.send(mailSettings); |
| 265 | +}; |
| 266 | + |
| 267 | +const emailChapterRequestCreate = async (email: string, childName: string) => { |
| 268 | + const mailSettings: MailDataRequired = { |
| 269 | + from: { |
| 270 | + email: process.env.SENDGRID_EMAIL_ADDRESS || '[email protected]', |
| 271 | + name: 'Box of Balloons, Inc.', |
| 272 | + }, |
| 273 | + to: email, |
| 274 | + subject: 'New Birthday Box Request Received', |
| 275 | + html: ` |
| 276 | + <p>Hello,</p> |
| 277 | + |
| 278 | + <p>A new birthday box request has been submitted for ${childName}. Please review this request |
| 279 | + in your dashboard and either approve or deny it.</p> |
| 280 | + |
| 281 | + <p>Thank you for your dedication to making birthdays special!</p> |
| 282 | + |
| 283 | + <p>Box of Balloons, Inc. - Automated response</p> |
| 284 | + `, |
| 285 | + }; |
| 286 | + |
| 287 | + await SGmail.send(mailSettings); |
| 288 | +}; |
| 289 | + |
131 | 290 | export {
|
132 | 291 | emailVerificationLink,
|
133 | 292 | emailResetPasswordLink,
|
134 | 293 | emailInviteLink,
|
135 | 294 | emailRequestUpdate,
|
136 | 295 | emailRequestDelete,
|
| 296 | + emailRequestCreate, |
| 297 | + emailRequestApproved, |
| 298 | + emailRequestDenied, |
| 299 | + emailRequestDelivered, |
| 300 | + emailChapterRequestCreate, |
137 | 301 | };
|
0 commit comments