fix: update sending domain to psbailey.uk
- Change FROM_EMAIL to use verified domain psbailey.uk - Add payload logging for debugging - Still getting 'invalid credentials' from AhaSend API The API v1 key may need activation time or account verification. All notification system code is complete and ready.
This commit is contained in:
@@ -3,7 +3,7 @@ import axios from 'axios';
|
|||||||
// AhaSend API configuration
|
// AhaSend API configuration
|
||||||
const AHASEND_API_KEY = process.env.AHASEND_API_KEY || 'pxZ2d30PIqTl6Uj7p6g3o0uez2AacMaOstKCTcj9MTIrNEBvhikgvyAARUTvXAcA';
|
const AHASEND_API_KEY = process.env.AHASEND_API_KEY || 'pxZ2d30PIqTl6Uj7p6g3o0uez2AacMaOstKCTcj9MTIrNEBvhikgvyAARUTvXAcA';
|
||||||
const AHASEND_ACCOUNT_ID = process.env.AHASEND_ACCOUNT_ID || '8a14f9a5-6e6d-47c9-b5d6-a687265b36a3';
|
const AHASEND_ACCOUNT_ID = process.env.AHASEND_ACCOUNT_ID || '8a14f9a5-6e6d-47c9-b5d6-a687265b36a3';
|
||||||
const FROM_EMAIL = process.env.FROM_EMAIL || 'Beach Litter Platform <noreply@beachlitter.ie>';
|
const FROM_EMAIL = process.env.FROM_EMAIL || 'Beach Litter Platform <noreply@psbailey.uk>';
|
||||||
|
|
||||||
interface EmailData {
|
interface EmailData {
|
||||||
to: string;
|
to: string;
|
||||||
@@ -28,14 +28,14 @@ export class EmailService {
|
|||||||
|
|
||||||
console.log('[Email] Sending request to AhaSend API...');
|
console.log('[Email] Sending request to AhaSend API...');
|
||||||
console.log('[Email] API Key:', AHASEND_API_KEY.substring(0, 30) + '...');
|
console.log('[Email] API Key:', AHASEND_API_KEY.substring(0, 30) + '...');
|
||||||
console.log('[Email] Account ID:', AHASEND_ACCOUNT_ID);
|
console.log('[Email] Payload:', JSON.stringify(payload, null, 2));
|
||||||
|
|
||||||
const response = await axios.post(
|
const response = await axios.post(
|
||||||
`https://api.ahasend.com/v1/messages`,
|
`https://api.ahasend.com/v1/messages`,
|
||||||
payload,
|
payload,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
'x-api-key': AHASEND_API_KEY,
|
'X-API-Key': AHASEND_API_KEY,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user