handling changes to stripe account where owner needs to provide information
This commit is contained in:
@@ -213,6 +213,46 @@ class PaymentEmailService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send notification when owner's payouts are disabled due to requirements
|
||||
* @param {string} ownerEmail - Owner's email address
|
||||
* @param {Object} params - Email parameters
|
||||
* @param {string} params.ownerName - Owner's name
|
||||
* @param {string} params.disabledReason - Human-readable reason for disabling
|
||||
* @returns {Promise<{success: boolean, messageId?: string, error?: string}>}
|
||||
*/
|
||||
async sendPayoutsDisabledEmail(ownerEmail, params) {
|
||||
if (!this.initialized) {
|
||||
await this.initialize();
|
||||
}
|
||||
|
||||
try {
|
||||
const { ownerName, disabledReason } = params;
|
||||
|
||||
const variables = {
|
||||
ownerName: ownerName || "there",
|
||||
disabledReason:
|
||||
disabledReason ||
|
||||
"Additional verification is required for your account.",
|
||||
earningsUrl: `${process.env.FRONTEND_URL}/earnings`,
|
||||
};
|
||||
|
||||
const htmlContent = await this.templateManager.renderTemplate(
|
||||
"payoutsDisabledToOwner",
|
||||
variables
|
||||
);
|
||||
|
||||
return await this.emailClient.sendEmail(
|
||||
ownerEmail,
|
||||
"Action Required: Your payouts have been paused - Village Share",
|
||||
htmlContent
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Failed to send payouts disabled email:", error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send dispute alert to platform admin
|
||||
* Called when a new dispute is opened
|
||||
|
||||
Reference in New Issue
Block a user