UNPKG

@letanure/resend-cli

Version:

A command-line interface for Resend email API

38 lines 1.16 kB
import { Resend } from 'resend'; import { formatResendError } from '../../../utils/resendErrors.js'; /** * Updates a scheduled email using the Resend API * * @param data - Email data for update * @param apiKey - API key for Resend API * @returns Promise<ApiResult<UpdateEmailResponseData>> - Standard result format */ export async function updateEmail(data, apiKey) { try { const resend = new Resend(apiKey); const { data: responseData, error } = await resend.emails.update(data); if (error) { return { success: false, error: formatResendError(error, 'update email', data), }; } if (!responseData) { return { success: false, error: formatResendError('No data returned from API', 'update email', data), }; } return { success: true, data: responseData, }; } catch (error) { return { success: false, error: formatResendError(error, 'update email', data), }; } } //# sourceMappingURL=action.js.map