Merge pull request 'chore: Update email FROM address and fix unsubscribe link' (#222) from issue-221-update-email-from-and-unsubscribe into main
All checks were successful
Deploy to Staging / Build Images (push) Successful in 35s
Deploy to Staging / Deploy to Staging (push) Successful in 51s
Deploy to Staging / Verify Staging (push) Successful in 9s
Deploy to Staging / Notify Staging Ready (push) Successful in 8s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
All checks were successful
Deploy to Staging / Build Images (push) Successful in 35s
Deploy to Staging / Deploy to Staging (push) Successful in 51s
Deploy to Staging / Verify Staging (push) Successful in 9s
Deploy to Staging / Notify Staging Ready (push) Successful in 8s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
Reviewed-on: #222
This commit was merged in pull request #222.
This commit is contained in:
@@ -97,7 +97,7 @@ Templates use `{{variableName}}` syntax for variable substitution.
|
|||||||
|
|
||||||
### Environment Variables
|
### Environment Variables
|
||||||
- `RESEND_API_KEY` - Resend API key (required, stored in secrets)
|
- `RESEND_API_KEY` - Resend API key (required, stored in secrets)
|
||||||
- `FROM_EMAIL` - Sender email address (default: noreply@motovaultpro.com)
|
- `FROM_EMAIL` - Sender email address (default: hello@notify.motovaultpro.com)
|
||||||
|
|
||||||
### Email Delivery
|
### Email Delivery
|
||||||
- Uses Resend API for transactional emails
|
- Uses Resend API for transactional emails
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
import { EMAIL_STYLES } from './email-styles';
|
import { EMAIL_STYLES } from './email-styles';
|
||||||
|
|
||||||
// External logo URL - hosted on GitHub for reliability
|
// External logo URL - hosted on GitHub for reliability
|
||||||
const LOGO_URL = 'https://raw.githubusercontent.com/ericgullickson/images/c58b0e4773e8395b532f97f6ab529e38ea4dc8be/motovaultpro-auth0-small.png';
|
const LOGO_URL = 'https://motovaultpro.com/images/logos/motovaultpro-auth0-small.png';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders the complete HTML email layout with branding
|
* Renders the complete HTML email layout with branding
|
||||||
@@ -65,10 +65,10 @@ export function renderEmailLayout(content: string): string {
|
|||||||
<a href="https://motovaultpro.com" style="${EMAIL_STYLES.footerLink}" target="_blank">Login to MotoVaultPro</a>
|
<a href="https://motovaultpro.com" style="${EMAIL_STYLES.footerLink}" target="_blank">Login to MotoVaultPro</a>
|
||||||
</p>
|
</p>
|
||||||
<p style="${EMAIL_STYLES.footerText}">
|
<p style="${EMAIL_STYLES.footerText}">
|
||||||
<a href="{{unsubscribeUrl}}" style="${EMAIL_STYLES.footerLink}" target="_blank">Manage Email Preferences</a>
|
<a href="https://motovaultpro.com/settings" style="${EMAIL_STYLES.footerLink}" target="_blank">Manage Email Preferences</a>
|
||||||
</p>
|
</p>
|
||||||
<p style="${EMAIL_STYLES.copyright}">
|
<p style="${EMAIL_STYLES.copyright}">
|
||||||
© {new Date().getFullYear()} MotoVaultPro. All rights reserved.
|
© ${new Date().getFullYear()} MotoVaultPro. All rights reserved.
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export class EmailService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.resend = new Resend(apiKey);
|
this.resend = new Resend(apiKey);
|
||||||
this.fromEmail = process.env['FROM_EMAIL'] || 'info@notify.motovaultpro.com';
|
this.fromEmail = process.env['FROM_EMAIL'] || 'hello@notify.motovaultpro.com';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,6 +33,10 @@ export class EmailService {
|
|||||||
to,
|
to,
|
||||||
subject,
|
subject,
|
||||||
html,
|
html,
|
||||||
|
headers: {
|
||||||
|
'List-Unsubscribe': '<https://motovaultpro.com/settings>',
|
||||||
|
'List-Unsubscribe-Post': 'List-Unsubscribe=One-Click',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ echo " Subject: $SUBJECT"
|
|||||||
# Build JSON payload
|
# Build JSON payload
|
||||||
JSON_PAYLOAD=$(cat <<EOF
|
JSON_PAYLOAD=$(cat <<EOF
|
||||||
{
|
{
|
||||||
"from": "MotoVaultPro <deploy@notify.motovaultpro.com>",
|
"from": "MotoVaultPro <hello@notify.motovaultpro.com>",
|
||||||
"to": ["$NOTIFY_EMAIL"],
|
"to": ["$NOTIFY_EMAIL"],
|
||||||
"subject": "$SUBJECT",
|
"subject": "$SUBJECT",
|
||||||
"html": $(echo "$HTML_BODY" | jq -Rs .)
|
"html": $(echo "$HTML_BODY" | jq -Rs .)
|
||||||
|
|||||||
Reference in New Issue
Block a user