File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ DATABASE_URL="file:./dev.db"
1111# Check the logs which print out the content of every "email" sent for any manual verification you need to do or links you need to open
1212MAILGUN_SENDING_KEY = key-some-mailgun-key
1313MAILGUN_DOMAIN = some.domain.com
14+ EMAIL_FROM = Rumah Berbagi <admin@rumahberbagi.com>
1415
1516# Feature: authentication
1617# Mocked: Unnecessary (any value can be used)
Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ import type { SendEmailFunction } from 'remix-auth-email-link'
44import * as emailProvider from '~/services/email-provider.server'
55import { writeFixture } from '~/utils/fixtures'
66
7+ let emailFrom = 'Rumah Berbagi <admin@rumahberbagi.com>'
8+ if ( process . env . EMAIL_FROM ) {
9+ emailFrom = process . env . EMAIL_FROM
10+ }
11+
712export const sendEmail : SendEmailFunction < User > = async ( options ) => {
813 const subject = 'Link login untuk Kelas Rumah Berbagi'
914 const body = renderToString (
@@ -42,7 +47,7 @@ export const sendEmail: SendEmailFunction<User> = async (options) => {
4247 } else {
4348 await emailProvider . sendEmail ( {
4449 to : options . emailAddress ,
45- from : 'Rumah Berbagi <admin@rumahberbagi.com>' ,
50+ from : emailFrom ,
4651 subject,
4752 html : body ,
4853 } )
You can’t perform that action at this time.
0 commit comments