@segment/action-destinations 3.188.0 → 3.190.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/app-fit/index.js +2 -2
- package/dist/destinations/app-fit/index.js.map +1 -1
- package/dist/destinations/app-fit/track/index.js +1 -1
- package/dist/destinations/app-fit/track/index.js.map +1 -1
- package/dist/destinations/attio/index.js +1 -1
- package/dist/destinations/attio/index.js.map +1 -1
- package/dist/destinations/{engage-messaging-twilio/utils/types.js → engage/sendgrid/Profile.js} +1 -1
- package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
- package/dist/destinations/engage/sendgrid/destinationDefinition.d.ts +3 -0
- package/dist/destinations/engage/sendgrid/destinationDefinition.js +70 -0
- package/dist/destinations/engage/sendgrid/destinationDefinition.js.map +1 -0
- package/dist/destinations/engage/sendgrid/generated-types.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/generated-types.js +14 -0
- package/dist/destinations/engage/sendgrid/generated-types.js.map +1 -0
- package/dist/destinations/engage/sendgrid/index.d.ts +2 -0
- package/dist/destinations/engage/sendgrid/index.js +5 -0
- package/dist/destinations/engage/sendgrid/index.js.map +1 -0
- package/dist/destinations/{engage-messaging-sendgrid/previewApiLookup/index.d.ts → engage/sendgrid/previewApiLookup/actionDefinition.d.ts} +1 -2
- package/dist/destinations/{engage-messaging-sendgrid/previewApiLookup/index.js → engage/sendgrid/previewApiLookup/actionDefinition.js} +4 -4
- package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.js.map +1 -0
- package/dist/destinations/{engage-messaging-sendgrid/utils → engage/sendgrid/previewApiLookup}/api-lookups.d.ts +2 -4
- package/dist/destinations/{engage-messaging-sendgrid/utils → engage/sendgrid/previewApiLookup}/api-lookups.js +1 -15
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js +14 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js.map +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.d.ts +2 -0
- package/dist/destinations/{engage-messaging-twilio/utils → engage/sendgrid/previewApiLookup}/index.js +2 -6
- package/dist/destinations/engage/sendgrid/previewApiLookup/index.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.d.ts +42 -0
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +318 -0
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.d.ts +12 -0
- package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js +3 -0
- package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.d.ts +4 -0
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js +236 -0
- package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/generated-types.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js +14 -0
- package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/index.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/index.js +14 -0
- package/dist/destinations/engage/sendgrid/sendEmail/index.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js +23 -0
- package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js.map +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js +14 -0
- package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js.map +1 -0
- package/dist/destinations/engage/twilio/destinationDefinition.d.ts +3 -0
- package/dist/destinations/engage/twilio/destinationDefinition.js +172 -0
- package/dist/destinations/engage/twilio/destinationDefinition.js.map +1 -0
- package/dist/destinations/engage/twilio/generated-types.d.ts +1 -0
- package/dist/destinations/engage/twilio/generated-types.js +14 -0
- package/dist/destinations/engage/twilio/generated-types.js.map +1 -0
- package/dist/destinations/engage/twilio/index.d.ts +2 -0
- package/dist/destinations/engage/twilio/index.js +5 -0
- package/dist/destinations/engage/twilio/index.js.map +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.d.ts +27 -0
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js +142 -0
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js.map +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.d.ts +4 -0
- package/dist/destinations/{engage-messaging-twilio/sendMobilePush/index.js → engage/twilio/sendMobilePush/actionDefinition.js} +5 -5
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js.map +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/generated-types.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js +14 -0
- package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js.map +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/index.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/index.js +14 -0
- package/dist/destinations/engage/twilio/sendMobilePush/index.js.map +1 -0
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.d.ts +9 -0
- package/dist/destinations/{engage-messaging-twilio/sendSms/sms-sender.js → engage/twilio/sendSms/SmsMessageSender.js} +5 -32
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +1 -0
- package/dist/destinations/engage/twilio/sendSms/actionDefinition.d.ts +4 -0
- package/dist/destinations/{engage-messaging-twilio/sendSms/index.js → engage/twilio/sendSms/actionDefinition.js} +5 -5
- package/dist/destinations/engage/twilio/sendSms/actionDefinition.js.map +1 -0
- package/dist/destinations/engage/twilio/sendSms/generated-types.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendSms/generated-types.js +14 -0
- package/dist/destinations/engage/twilio/sendSms/generated-types.js.map +1 -0
- package/dist/destinations/engage/twilio/sendSms/index.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendSms/index.js +14 -0
- package/dist/destinations/engage/twilio/sendSms/index.js.map +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.d.ts +8 -0
- package/dist/destinations/{engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js → engage/twilio/sendWhatsApp/WhatsAppMessageSender.js} +8 -4
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js.map +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.d.ts +4 -0
- package/dist/destinations/{engage-messaging-twilio/sendWhatsApp/index.js → engage/twilio/sendWhatsApp/actionDefinition.js} +5 -5
- package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.js.map +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js +14 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js.map +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/index.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/index.js +14 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/index.js.map +1 -0
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.d.ts +16 -0
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js +57 -0
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js.map +1 -0
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.d.ts +16 -0
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js +109 -0
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +1 -0
- package/dist/destinations/engage/twilio/utils/index.d.ts +2 -0
- package/dist/destinations/engage/twilio/utils/index.js +15 -0
- package/dist/destinations/engage/twilio/utils/index.js.map +1 -0
- package/dist/destinations/{engage-messaging-twilio → engage/twilio}/utils/types.d.ts +0 -16
- package/dist/destinations/engage/twilio/utils/types.js.map +1 -0
- package/dist/destinations/engage/utils/AggregateError.d.ts +14 -0
- package/dist/destinations/engage/utils/AggregateError.js +26 -0
- package/dist/destinations/engage/utils/AggregateError.js.map +1 -0
- package/dist/destinations/engage/utils/EngageActionPerformer.d.ts +41 -0
- package/dist/destinations/engage/utils/EngageActionPerformer.js +135 -0
- package/dist/destinations/engage/utils/EngageActionPerformer.js.map +1 -0
- package/dist/destinations/{engage-messaging-twilio/utils/MessageLogger.d.ts → engage/utils/EngageLogger.d.ts} +8 -5
- package/dist/destinations/engage/utils/EngageLogger.js +52 -0
- package/dist/destinations/engage/utils/EngageLogger.js.map +1 -0
- package/dist/destinations/engage/utils/EngageStats.d.ts +18 -0
- package/dist/destinations/{engage-messaging-twilio/utils/MessageStats.js → engage/utils/EngageStats.js} +28 -14
- package/dist/destinations/engage/utils/EngageStats.js.map +1 -0
- package/dist/destinations/{engage-messaging-twilio → engage}/utils/IntegrationErrorWrapper.d.ts +2 -2
- package/dist/destinations/{engage-messaging-twilio → engage}/utils/IntegrationErrorWrapper.js +1 -1
- package/dist/destinations/engage/utils/IntegrationErrorWrapper.js.map +1 -0
- package/dist/destinations/engage/utils/MessageSendPerformer.d.ts +63 -0
- package/dist/destinations/engage/utils/MessageSendPerformer.js +191 -0
- package/dist/destinations/engage/utils/MessageSendPerformer.js.map +1 -0
- package/dist/destinations/engage/utils/ResponseError.d.ts +20 -0
- package/dist/destinations/engage/utils/ResponseError.js +17 -0
- package/dist/destinations/engage/utils/ResponseError.js.map +1 -0
- package/dist/destinations/engage/utils/getProfileApiEndpoint.d.ts +2 -0
- package/dist/destinations/engage/utils/getProfileApiEndpoint.js +10 -0
- package/dist/destinations/engage/utils/getProfileApiEndpoint.js.map +1 -0
- package/dist/destinations/engage/utils/index.d.ts +9 -0
- package/dist/destinations/engage/utils/index.js +22 -0
- package/dist/destinations/engage/utils/index.js.map +1 -0
- package/dist/destinations/engage/utils/isDestinationActionService.js.map +1 -0
- package/dist/destinations/engage/utils/isRetryableError.d.ts +2 -0
- package/dist/destinations/engage/utils/isRetryableError.js +33 -0
- package/dist/destinations/engage/utils/isRetryableError.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationDecorator.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationDuration.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.js.map +1 -0
- package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationFinallyHooks.d.ts +4 -0
- package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationFinallyHooks.js +2 -0
- package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js.map +1 -0
- package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationLogger.d.ts +2 -1
- package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationLogger.js +22 -25
- package/dist/destinations/engage/utils/operationTracking/OperationLogger.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationStats.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/OperationTree.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/TrackedError.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/index.js.map +1 -0
- package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.js.map +1 -0
- package/dist/destinations/engage/utils/testUtils.d.ts +6 -0
- package/dist/destinations/engage/utils/testUtils.js +26 -0
- package/dist/destinations/engage/utils/testUtils.js.map +1 -0
- package/dist/destinations/engage/utils/track.d.ts +52 -0
- package/dist/destinations/engage/utils/track.js +9 -0
- package/dist/destinations/engage/utils/track.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/index.d.ts +2 -3
- package/dist/destinations/engage-messaging-sendgrid/index.js +13 -67
- package/dist/destinations/engage-messaging-sendgrid/index.js.map +1 -1
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js +3 -0
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js.map +1 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js +3 -0
- package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/index.d.ts +2 -3
- package/dist/destinations/engage-messaging-twilio/index.js +13 -169
- package/dist/destinations/engage-messaging-twilio/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendSms.types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendSms.types.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js +3 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js.map +1 -0
- package/dist/destinations/hilo/generated-types.d.ts +3 -0
- package/dist/destinations/hilo/generated-types.js.map +1 -0
- package/dist/destinations/hilo/group/generated-types.d.ts +9 -0
- package/dist/destinations/hilo/group/generated-types.js.map +1 -0
- package/dist/destinations/hilo/group/index.js +59 -0
- package/dist/destinations/hilo/group/index.js.map +1 -0
- package/dist/destinations/hilo/identify/generated-types.d.ts +8 -0
- package/dist/destinations/hilo/identify/generated-types.js.map +1 -0
- package/dist/destinations/hilo/identify/index.js +51 -0
- package/dist/destinations/hilo/identify/index.js.map +1 -0
- package/dist/destinations/hilo/index.d.ts +4 -0
- package/dist/destinations/hilo/index.js +103 -0
- package/dist/destinations/hilo/index.js.map +1 -0
- package/dist/destinations/hilo/page/generated-types.d.ts +9 -0
- package/dist/destinations/hilo/page/generated-types.js.map +1 -0
- package/dist/destinations/{engage-messaging-sendgrid/sendEmail → hilo/page}/index.d.ts +1 -1
- package/dist/destinations/hilo/page/index.js +59 -0
- package/dist/destinations/hilo/page/index.js.map +1 -0
- package/dist/destinations/hilo/screen/generated-types.d.ts +9 -0
- package/dist/destinations/hilo/screen/generated-types.js.map +1 -0
- package/dist/destinations/{engage-messaging-twilio/sendMobilePush → hilo/screen}/index.d.ts +1 -1
- package/dist/destinations/hilo/screen/index.js +59 -0
- package/dist/destinations/hilo/screen/index.js.map +1 -0
- package/dist/destinations/hilo/track/generated-types.d.ts +9 -0
- package/dist/destinations/hilo/track/generated-types.js +3 -0
- package/dist/destinations/hilo/track/generated-types.js.map +1 -0
- package/dist/destinations/hilo/track/index.d.ts +5 -0
- package/dist/destinations/hilo/track/index.js +59 -0
- package/dist/destinations/hilo/track/index.js.map +1 -0
- package/dist/destinations/hubspot/api/index.d.ts +11 -5
- package/dist/destinations/hubspot/api/index.js +59 -24
- package/dist/destinations/hubspot/api/index.js.map +1 -1
- package/dist/destinations/hubspot/errors.d.ts +2 -0
- package/dist/destinations/hubspot/errors.js +3 -1
- package/dist/destinations/hubspot/errors.js.map +1 -1
- package/dist/destinations/hubspot/upsertCompany/index.js +1 -1
- package/dist/destinations/hubspot/upsertCompany/index.js.map +1 -1
- package/dist/destinations/hubspot/upsertCustomObjectRecord/generated-types.d.ts +5 -0
- package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js +113 -22
- package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js.map +1 -1
- package/dist/destinations/hubspot/utils.d.ts +23 -0
- package/dist/destinations/hubspot/utils.js +7 -1
- package/dist/destinations/hubspot/utils.js.map +1 -1
- package/dist/destinations/index.js +3 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/iterable/generated-types.d.ts +1 -0
- package/dist/destinations/iterable/index.js +20 -1
- package/dist/destinations/iterable/index.js.map +1 -1
- package/dist/destinations/iterable/index.test.d.ts +1 -0
- package/dist/destinations/iterable/index.test.js +46 -0
- package/dist/destinations/iterable/index.test.js.map +1 -0
- package/dist/destinations/iterable/shared-fields.d.ts +1 -0
- package/dist/destinations/iterable/trackEvent/index.js +3 -2
- package/dist/destinations/iterable/trackEvent/index.js.map +1 -1
- package/dist/destinations/iterable/trackPurchase/index.js +3 -2
- package/dist/destinations/iterable/trackPurchase/index.js.map +1 -1
- package/dist/destinations/iterable/updateCart/index.js +3 -2
- package/dist/destinations/iterable/updateCart/index.js.map +1 -1
- package/dist/destinations/iterable/updateUser/index.js +3 -2
- package/dist/destinations/iterable/updateUser/index.js.map +1 -1
- package/dist/destinations/iterable/utils.d.ts +9 -1
- package/dist/destinations/iterable/utils.js +18 -1
- package/dist/destinations/iterable/utils.js.map +1 -1
- package/dist/destinations/rehook/generated-types.d.ts +4 -0
- package/dist/destinations/rehook/generated-types.js +3 -0
- package/dist/destinations/rehook/generated-types.js.map +1 -0
- package/dist/destinations/rehook/identifyUser/generated-types.d.ts +7 -0
- package/dist/destinations/rehook/identifyUser/generated-types.js +3 -0
- package/dist/destinations/rehook/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/rehook/identifyUser/index.d.ts +5 -0
- package/dist/destinations/rehook/identifyUser/index.js +44 -0
- package/dist/destinations/rehook/identifyUser/index.js.map +1 -0
- package/dist/destinations/rehook/index.d.ts +4 -0
- package/dist/destinations/rehook/index.js +47 -0
- package/dist/destinations/rehook/index.js.map +1 -0
- package/dist/destinations/rehook/trackEvent/generated-types.d.ts +7 -0
- package/dist/destinations/rehook/trackEvent/generated-types.js +3 -0
- package/dist/destinations/rehook/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/rehook/trackEvent/index.d.ts +5 -0
- package/dist/destinations/rehook/trackEvent/index.js +48 -0
- package/dist/destinations/rehook/trackEvent/index.js.map +1 -0
- package/package.json +2 -2
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/generated-types.js.map +0 -1
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/index.js.map +0 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.js.map +0 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +0 -578
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +0 -1
- package/dist/destinations/engage-messaging-sendgrid/utils/api-lookups.js.map +0 -1
- package/dist/destinations/engage-messaging-sendgrid/utils/types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/GenericMethodDecorator.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/OperationDecorator.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/OperationDuration.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/OperationErrorHandler.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/OperationFinallyHooks.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/OperationLogger.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/OperationStats.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/OperationTracker.test.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/OperationTree.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/TrackedError.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/index.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/operationTracking/wrapTryCatchFinallyPromisable.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/generated-types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/index.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/push-sender.d.ts +0 -17
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/push-sender.js +0 -182
- package/dist/destinations/engage-messaging-twilio/sendMobilePush/push-sender.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.d.ts +0 -9
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.d.ts +0 -7
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/IntegrationErrorWrapper.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/MessageLogger.js +0 -36
- package/dist/destinations/engage-messaging-twilio/utils/MessageLogger.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/MessageStats.d.ts +0 -14
- package/dist/destinations/engage-messaging-twilio/utils/MessageStats.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/index.d.ts +0 -6
- package/dist/destinations/engage-messaging-twilio/utils/index.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/isDestinationActionService.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.d.ts +0 -43
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js +0 -203
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/phone-message.d.ts +0 -19
- package/dist/destinations/engage-messaging-twilio/utils/phone-message.js +0 -97
- package/dist/destinations/engage-messaging-twilio/utils/phone-message.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/track.d.ts +0 -45
- package/dist/destinations/engage-messaging-twilio/utils/track.js +0 -9
- package/dist/destinations/engage-messaging-twilio/utils/track.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/types.js.map +0 -1
- /package/dist/destinations/{engage-messaging-sendgrid/utils/types.d.ts → engage/sendgrid/Profile.d.ts} +0 -0
- /package/dist/destinations/{engage-messaging-sendgrid → engage/twilio}/utils/types.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage}/utils/isDestinationActionService.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage}/utils/isDestinationActionService.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/GenericMethodDecorator.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/GenericMethodDecorator.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDecorator.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDecorator.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDuration.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDuration.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationErrorHandler.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationErrorHandler.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationStats.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationStats.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTracker.test.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTracker.test.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTree.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTree.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/TrackedError.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/TrackedError.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/index.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/index.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/wrapTryCatchFinallyPromisable.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/wrapTryCatchFinallyPromisable.js +0 -0
- /package/dist/destinations/engage-messaging-sendgrid/{previewApiLookup/generated-types.d.ts → previewApiLookup.types.d.ts} +0 -0
- /package/dist/destinations/engage-messaging-sendgrid/{sendEmail/generated-types.d.ts → sendEmail.types.d.ts} +0 -0
- /package/dist/destinations/engage-messaging-twilio/{sendMobilePush/generated-types.d.ts → sendMobilePush.types.d.ts} +0 -0
- /package/dist/destinations/engage-messaging-twilio/{sendSms/generated-types.d.ts → sendSms.types.d.ts} +0 -0
- /package/dist/destinations/engage-messaging-twilio/{sendWhatsApp/generated-types.d.ts → sendWhatsApp.types.d.ts} +0 -0
- /package/dist/destinations/{engage-messaging-sendgrid/previewApiLookup → hilo}/generated-types.js +0 -0
- /package/dist/destinations/{engage-messaging-sendgrid/sendEmail → hilo/group}/generated-types.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio/sendSms → hilo/group}/index.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio/sendMobilePush → hilo/identify}/generated-types.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio/sendWhatsApp → hilo/identify}/index.d.ts +0 -0
- /package/dist/destinations/{engage-messaging-twilio/sendSms → hilo/page}/generated-types.js +0 -0
- /package/dist/destinations/{engage-messaging-twilio/sendWhatsApp → hilo/screen}/generated-types.js +0 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SendEmailPerformer = exports.Liquid = exports.EXTERNAL_ID_KEY = void 0;
|
|
13
|
+
const utils_1 = require("../../utils");
|
|
14
|
+
const liquidjs_1 = require("liquidjs");
|
|
15
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
16
|
+
const previewApiLookup_1 = require("../previewApiLookup");
|
|
17
|
+
const insertEmailPreviewText_1 = require("./insertEmailPreviewText");
|
|
18
|
+
const cheerio_1 = __importDefault(require("cheerio"));
|
|
19
|
+
const isRestrictedDomain_1 = require("./isRestrictedDomain");
|
|
20
|
+
exports.EXTERNAL_ID_KEY = 'email';
|
|
21
|
+
exports.Liquid = new liquidjs_1.Liquid();
|
|
22
|
+
class SendEmailPerformer extends utils_1.MessageSendPerformer {
|
|
23
|
+
getIntegrationStatsName() {
|
|
24
|
+
return 'actions_personas_messaging_sendgrid';
|
|
25
|
+
}
|
|
26
|
+
getChannelType() {
|
|
27
|
+
return 'email';
|
|
28
|
+
}
|
|
29
|
+
getDefaultSettingsRegion() {
|
|
30
|
+
return 'us-west-2';
|
|
31
|
+
}
|
|
32
|
+
isSupportedExternalId(externalId) {
|
|
33
|
+
return externalId.type === 'email';
|
|
34
|
+
}
|
|
35
|
+
isExternalIdSubscribed(extId) {
|
|
36
|
+
const bypass_subscription = this.payload.byPassSubscription !== undefined && this.payload.byPassSubscription;
|
|
37
|
+
if (bypass_subscription) {
|
|
38
|
+
this.currentOperation?.logs.push('Bypassing subscription');
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
const isSubscribed = super.isExternalIdSubscribed(extId);
|
|
42
|
+
if (!isSubscribed)
|
|
43
|
+
return isSubscribed;
|
|
44
|
+
if (!this.payload.groupId)
|
|
45
|
+
return isSubscribed;
|
|
46
|
+
const recepientGroup = extId.groups?.find((g) => g.id === this.payload.groupId);
|
|
47
|
+
if (!recepientGroup) {
|
|
48
|
+
this.statsClient.incr('group_notfound', 1);
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
if (!recepientGroup.isSubscribed) {
|
|
52
|
+
this.statsClient.incr('group_notsubscribed', 1);
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
getRecepients() {
|
|
58
|
+
if (this.payload.toEmail)
|
|
59
|
+
return [
|
|
60
|
+
{
|
|
61
|
+
id: this.payload.toEmail,
|
|
62
|
+
type: 'email',
|
|
63
|
+
groups: [
|
|
64
|
+
{
|
|
65
|
+
id: this.payload.groupId
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
const res = super.getRecepients();
|
|
71
|
+
if (res.length > 0)
|
|
72
|
+
return [res[0]];
|
|
73
|
+
return res;
|
|
74
|
+
}
|
|
75
|
+
async parseTemplating(content, liquidData, contentType) {
|
|
76
|
+
const parsedContent = await exports.Liquid.parseAndRender(content, liquidData);
|
|
77
|
+
this.logOnError(() => 'Content type: ' + contentType);
|
|
78
|
+
return parsedContent;
|
|
79
|
+
}
|
|
80
|
+
async sendToRecepient(emailProfile) {
|
|
81
|
+
const traits = await this.getProfileTraits();
|
|
82
|
+
const profile = {
|
|
83
|
+
email: emailProfile?.id,
|
|
84
|
+
traits
|
|
85
|
+
};
|
|
86
|
+
const toEmail = profile.email;
|
|
87
|
+
if (!toEmail) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (isRestrictedDomain_1.isRestrictedDomain(toEmail)) {
|
|
91
|
+
this.tags.push('reason:restricted_domain');
|
|
92
|
+
throw new actions_core_1.IntegrationError('Emails with gmailx.com, yahoox.com, aolx.com, and hotmailx.com domains are blocked.', 'Invalid input', 400);
|
|
93
|
+
}
|
|
94
|
+
let name;
|
|
95
|
+
if (traits.first_name && traits.last_name) {
|
|
96
|
+
name = `${traits.first_name} ${traits.last_name}`;
|
|
97
|
+
}
|
|
98
|
+
else if (traits.firstName && traits.lastName) {
|
|
99
|
+
name = `${traits.firstName} ${traits.lastName}`;
|
|
100
|
+
}
|
|
101
|
+
else if (traits.name) {
|
|
102
|
+
name = traits.name;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
name = traits.first_name || traits.last_name || traits.firstName || traits.lastName || 'User';
|
|
106
|
+
}
|
|
107
|
+
const bcc = JSON.parse(this.payload.bcc ?? '[]');
|
|
108
|
+
const [parsedSubject, apiLookupData] = await Promise.all([
|
|
109
|
+
this.parseTemplating(this.payload.subject, { profile }, 'Subject'),
|
|
110
|
+
this.performApiLookups(this.payload.apiLookups, profile)
|
|
111
|
+
]);
|
|
112
|
+
const parsedBodyHtml = await this.getBodyHtml(profile, apiLookupData, emailProfile);
|
|
113
|
+
const mailContentSubscriptionHonored = {
|
|
114
|
+
personalizations: [
|
|
115
|
+
{
|
|
116
|
+
to: [
|
|
117
|
+
{
|
|
118
|
+
email: toEmail,
|
|
119
|
+
name: name
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
bcc: bcc.length > 0 ? bcc : undefined,
|
|
123
|
+
custom_args: {
|
|
124
|
+
...this.payload.customArgs,
|
|
125
|
+
source_id: this.settings.sourceId,
|
|
126
|
+
space_id: this.settings.spaceId,
|
|
127
|
+
user_id: this.payload.userId ?? undefined,
|
|
128
|
+
__segment_internal_external_id_key__: exports.EXTERNAL_ID_KEY,
|
|
129
|
+
__segment_internal_external_id_value__: profile[exports.EXTERNAL_ID_KEY]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
from: {
|
|
134
|
+
email: this.payload.fromEmail,
|
|
135
|
+
name: this.payload.fromName
|
|
136
|
+
},
|
|
137
|
+
reply_to: {
|
|
138
|
+
email: this.payload.replyToEmail,
|
|
139
|
+
name: this.payload.replyToName
|
|
140
|
+
},
|
|
141
|
+
subject: parsedSubject,
|
|
142
|
+
content: [
|
|
143
|
+
{
|
|
144
|
+
type: 'text/html',
|
|
145
|
+
value: parsedBodyHtml
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
tracking_settings: {
|
|
149
|
+
subscription_tracking: {
|
|
150
|
+
enable: true,
|
|
151
|
+
substitution_tag: '[unsubscribe]'
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
let mailContent;
|
|
156
|
+
if (this.payload.byPassSubscription) {
|
|
157
|
+
mailContent = {
|
|
158
|
+
...mailContentSubscriptionHonored,
|
|
159
|
+
mail_settings: {
|
|
160
|
+
bypass_list_management: {
|
|
161
|
+
enable: true
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
this.statsClient?.incr('request.by_pass_subscription', 1);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
mailContent = mailContentSubscriptionHonored;
|
|
169
|
+
this.statsClient?.incr('request.dont_pass_subscription', 1);
|
|
170
|
+
}
|
|
171
|
+
const req = {
|
|
172
|
+
method: 'post',
|
|
173
|
+
headers: {
|
|
174
|
+
authorization: `Bearer ${this.settings.sendGridApiKey}`
|
|
175
|
+
},
|
|
176
|
+
json: mailContent
|
|
177
|
+
};
|
|
178
|
+
this.statsClient?.set('message_body_size', JSON.stringify(req).length);
|
|
179
|
+
const response = await this.request('https://api.sendgrid.com/v3/mail/send', req);
|
|
180
|
+
if (this.payload?.eventOccurredTS != undefined) {
|
|
181
|
+
this.statsClient?.histogram('eventDeliveryTS', Date.now() - new Date(this.payload?.eventOccurredTS).getTime(), this.tags);
|
|
182
|
+
}
|
|
183
|
+
return response;
|
|
184
|
+
}
|
|
185
|
+
async getBodyHtml(profile, apiLookupData, emailProfile) {
|
|
186
|
+
let parsedBodyHtml;
|
|
187
|
+
if (this.payload.bodyUrl && this.settings.unlayerApiKey) {
|
|
188
|
+
const { content: body } = await this.request(this.payload.bodyUrl, { method: 'GET', skipResponseCloning: true });
|
|
189
|
+
const bodyHtml = this.payload.bodyType === 'html' ? body : await this.generateEmailHtml(body);
|
|
190
|
+
parsedBodyHtml = await this.parseTemplating(bodyHtml, { profile, [previewApiLookup_1.apiLookupLiquidKey]: apiLookupData }, 'Body');
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
parsedBodyHtml = await this.parseTemplating(this.payload.bodyHtml ?? '', { profile, [previewApiLookup_1.apiLookupLiquidKey]: apiLookupData }, 'Body HTML');
|
|
194
|
+
}
|
|
195
|
+
if (this.payload.bodyType === 'design' && this.payload.previewText) {
|
|
196
|
+
const parsedPreviewText = await this.parseTemplating(this.payload.previewText, { profile }, 'Preview text');
|
|
197
|
+
parsedBodyHtml = insertEmailPreviewText_1.insertEmailPreviewText(parsedBodyHtml, parsedPreviewText);
|
|
198
|
+
}
|
|
199
|
+
parsedBodyHtml = this.insertUnsubscribeLinks(parsedBodyHtml, emailProfile);
|
|
200
|
+
return parsedBodyHtml;
|
|
201
|
+
}
|
|
202
|
+
async generateEmailHtml(design) {
|
|
203
|
+
this.statsClient.incr('unlayer_request', 1);
|
|
204
|
+
const response = await this.request('https://api.unlayer.com/v2/export/html', {
|
|
205
|
+
method: 'POST',
|
|
206
|
+
headers: {
|
|
207
|
+
authorization: `Basic ${Buffer.from(`${this.settings.unlayerApiKey}:`).toString('base64')}`,
|
|
208
|
+
'content-type': 'application/json'
|
|
209
|
+
},
|
|
210
|
+
body: JSON.stringify({
|
|
211
|
+
displayMode: 'email',
|
|
212
|
+
design: JSON.parse(design)
|
|
213
|
+
})
|
|
214
|
+
});
|
|
215
|
+
const body = await response.json();
|
|
216
|
+
return body.data.html;
|
|
217
|
+
}
|
|
218
|
+
async performApiLookups(apiLookups, profile) {
|
|
219
|
+
if (!apiLookups) {
|
|
220
|
+
return {};
|
|
221
|
+
}
|
|
222
|
+
const request = this.request.bind(this);
|
|
223
|
+
const data = await Promise.all(apiLookups.map(async (apiLookup) => {
|
|
224
|
+
const data = await previewApiLookup_1.performApiLookup(request, apiLookup, profile, this.statsClient.statsClient, this.tags, this.settings, this.logger.loggerClient);
|
|
225
|
+
return { name: apiLookup.name, data };
|
|
226
|
+
}));
|
|
227
|
+
return data.reduce((acc, { name, data }) => {
|
|
228
|
+
acc[name] = data;
|
|
229
|
+
return acc;
|
|
230
|
+
}, {});
|
|
231
|
+
}
|
|
232
|
+
insertUnsubscribeLinks(html, emailProfile) {
|
|
233
|
+
const spaceId = this.settings.spaceId;
|
|
234
|
+
const groupId = this.payload.groupId;
|
|
235
|
+
const globalUnsubscribeLink = emailProfile?.unsubscribeLink;
|
|
236
|
+
const preferencesLink = emailProfile?.preferencesLink;
|
|
237
|
+
const unsubscribeLinkRef = 'a[href*="[upa_unsubscribe_link]"]';
|
|
238
|
+
const preferencesLinkRef = 'a[href*="[upa_preferences_link]"]';
|
|
239
|
+
const sendgridUnsubscribeLinkTag = '[unsubscribe]';
|
|
240
|
+
const $ = cheerio_1.default.load(html);
|
|
241
|
+
const _this = this;
|
|
242
|
+
if (groupId) {
|
|
243
|
+
const group = emailProfile.groups?.find((grp) => grp.id === groupId);
|
|
244
|
+
const groupUnsubscribeLink = group?.groupUnsubscribeLink;
|
|
245
|
+
$(unsubscribeLinkRef).each(function () {
|
|
246
|
+
if (!groupUnsubscribeLink) {
|
|
247
|
+
_this.logger.info(`Group Unsubscribe link missing`);
|
|
248
|
+
_this.statsClient.incr('group_unsubscribe_link_missing', 1);
|
|
249
|
+
$(this).attr('href', sendgridUnsubscribeLinkTag);
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
$(this).attr('href', groupUnsubscribeLink);
|
|
253
|
+
_this.logger?.info(`Group Unsubscribe link replaced`);
|
|
254
|
+
_this.statsClient?.incr('replaced_group_unsubscribe_link', 1);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
$(unsubscribeLinkRef).each(function () {
|
|
260
|
+
if (!globalUnsubscribeLink) {
|
|
261
|
+
_this.logger?.info(`Global Unsubscribe link missing`);
|
|
262
|
+
_this.statsClient?.incr('global_unsubscribe_link_missing', 1);
|
|
263
|
+
$(this).attr('href', sendgridUnsubscribeLinkTag);
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
$(this).attr('href', globalUnsubscribeLink);
|
|
267
|
+
_this.logger?.info(`Global Unsubscribe link replaced`);
|
|
268
|
+
_this.statsClient?.incr('replaced_global_unsubscribe_link', 1);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
$(preferencesLinkRef).each(function () {
|
|
273
|
+
if (!preferencesLink) {
|
|
274
|
+
$(this.parent?.children).each(function () {
|
|
275
|
+
if ($(this).text() == ' | ') {
|
|
276
|
+
$(this).remove();
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
$(this).remove();
|
|
280
|
+
_this.logger?.info(`Preferences link removed from the html body - ${spaceId}`);
|
|
281
|
+
_this.statsClient?.incr('removed_preferences_link', 1);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
$(this).attr('href', preferencesLink);
|
|
285
|
+
_this.logger?.info(`Preferences link replaced - ${spaceId}`);
|
|
286
|
+
_this.statsClient?.incr('replaced_preferences_link', 1);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
return $.html();
|
|
290
|
+
}
|
|
291
|
+
onResponse(args) {
|
|
292
|
+
const headers = args.response?.headers || args.error?.response.headers;
|
|
293
|
+
const sgMsgId = headers?.get('X-Message-ID');
|
|
294
|
+
if (sgMsgId)
|
|
295
|
+
args.operation.logs.push('[sendgrid]X-Message-ID: ' + sgMsgId);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
__decorate([
|
|
299
|
+
utils_1.track({
|
|
300
|
+
wrapIntegrationError: () => [`Unable to parse templating in email`, `templating parse failure`, 400]
|
|
301
|
+
})
|
|
302
|
+
], SendEmailPerformer.prototype, "parseTemplating", null);
|
|
303
|
+
__decorate([
|
|
304
|
+
utils_1.track()
|
|
305
|
+
], SendEmailPerformer.prototype, "getBodyHtml", null);
|
|
306
|
+
__decorate([
|
|
307
|
+
utils_1.track({
|
|
308
|
+
wrapIntegrationError: () => ['Unable to export email as HTML', 'Export HTML failure', 400]
|
|
309
|
+
})
|
|
310
|
+
], SendEmailPerformer.prototype, "generateEmailHtml", null);
|
|
311
|
+
__decorate([
|
|
312
|
+
utils_1.track()
|
|
313
|
+
], SendEmailPerformer.prototype, "performApiLookups", null);
|
|
314
|
+
__decorate([
|
|
315
|
+
utils_1.track()
|
|
316
|
+
], SendEmailPerformer.prototype, "insertUnsubscribeLinks", null);
|
|
317
|
+
exports.SendEmailPerformer = SendEmailPerformer;
|
|
318
|
+
//# sourceMappingURL=SendEmailPerformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendEmailPerformer.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAiG;AAIjG,uCAA6C;AAC7C,wDAAwE;AACxE,0DAA2F;AAC3F,qEAAiE;AACjE,sDAA6B;AAC7B,6DAAyD;AAG5C,QAAA,eAAe,GAAG,OAAO,CAAA;AAEzB,QAAA,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAEpC,MAAa,kBAAmB,SAAQ,4BAAuC;IAC7E,uBAAuB;QACrB,OAAO,qCAAqC,CAAA;IAC9C,CAAC;IAED,cAAc;QACZ,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,wBAAwB;QACtB,OAAO,WAAW,CA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O,CAAC,CAAA;IAC7E,CAAC;CACF;AAlSC;IAHC,aAAK,CAAC;QACL,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC,qCAAqC,EAAE,0BAA0B,EAAE,GAAG,CAAC;KACrG,CAAC;yDAYD;AAwHD;IADC,aAAK,EAAE;qDAqCP;AAKD;IAHC,aAAK,CAAC;QACL,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC,gCAAgC,EAAE,qBAAqB,EAAE,GAAG,CAAC;KAC3F,CAAC;2DAiBD;AASD;IADC,aAAK,EAAE;2DA0BP;AAGD;IADC,aAAK,EAAE;gEA0DP;AA3VH,gDAmWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnlayerResponse.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/sendEmail/UnlayerResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.actionDefinition = void 0;
|
|
4
|
+
const previewApiLookup_1 = require("../previewApiLookup");
|
|
5
|
+
const SendEmailPerformer_1 = require("./SendEmailPerformer");
|
|
6
|
+
exports.actionDefinition = {
|
|
7
|
+
title: 'Send Email',
|
|
8
|
+
description: 'Sends Email to a user powered by SendGrid',
|
|
9
|
+
defaultSubscription: 'type = "track" and event = "Audience Entered"',
|
|
10
|
+
fields: {
|
|
11
|
+
send: {
|
|
12
|
+
label: 'Send Message',
|
|
13
|
+
description: 'Whether or not the message should actually get sent.',
|
|
14
|
+
type: 'boolean',
|
|
15
|
+
required: false,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
traitEnrichment: {
|
|
19
|
+
label: 'Trait Enrich',
|
|
20
|
+
description: 'Whether or not trait enrich from event (i.e without profile api call)',
|
|
21
|
+
type: 'boolean',
|
|
22
|
+
required: false,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
userId: {
|
|
26
|
+
label: 'User ID',
|
|
27
|
+
description: 'User ID in Segment',
|
|
28
|
+
type: 'string',
|
|
29
|
+
required: false,
|
|
30
|
+
default: { '@path': '$.userId' }
|
|
31
|
+
},
|
|
32
|
+
toEmail: {
|
|
33
|
+
label: 'Test Email',
|
|
34
|
+
description: 'Email to send to when testing',
|
|
35
|
+
type: 'string'
|
|
36
|
+
},
|
|
37
|
+
fromDomain: {
|
|
38
|
+
label: 'From Domain',
|
|
39
|
+
description: 'Verified domain in Sendgrid',
|
|
40
|
+
type: 'string',
|
|
41
|
+
allowNull: true
|
|
42
|
+
},
|
|
43
|
+
fromEmail: {
|
|
44
|
+
label: 'From Email',
|
|
45
|
+
description: 'From Email',
|
|
46
|
+
type: 'string',
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
fromName: {
|
|
50
|
+
label: 'From Name',
|
|
51
|
+
description: 'From Name displayed to end user email',
|
|
52
|
+
type: 'string',
|
|
53
|
+
required: true
|
|
54
|
+
},
|
|
55
|
+
replyToEqualsFrom: {
|
|
56
|
+
label: 'Reply To Equals From',
|
|
57
|
+
description: 'Whether "reply to" settings are the same as "from"',
|
|
58
|
+
type: 'boolean'
|
|
59
|
+
},
|
|
60
|
+
replyToEmail: {
|
|
61
|
+
label: 'Reply To Email',
|
|
62
|
+
description: 'The Email used by user to Reply To',
|
|
63
|
+
type: 'string',
|
|
64
|
+
required: true
|
|
65
|
+
},
|
|
66
|
+
replyToName: {
|
|
67
|
+
label: 'Reply To Name',
|
|
68
|
+
description: 'The Name used by user to Reply To',
|
|
69
|
+
type: 'string',
|
|
70
|
+
required: true
|
|
71
|
+
},
|
|
72
|
+
bcc: {
|
|
73
|
+
label: 'BCC',
|
|
74
|
+
description: 'BCC list of emails',
|
|
75
|
+
type: 'string',
|
|
76
|
+
required: true
|
|
77
|
+
},
|
|
78
|
+
previewText: {
|
|
79
|
+
label: 'Preview Text',
|
|
80
|
+
description: 'Preview Text',
|
|
81
|
+
type: 'string'
|
|
82
|
+
},
|
|
83
|
+
subject: {
|
|
84
|
+
label: 'Subject',
|
|
85
|
+
description: 'Subject for the email to be sent',
|
|
86
|
+
type: 'string',
|
|
87
|
+
required: true
|
|
88
|
+
},
|
|
89
|
+
body: {
|
|
90
|
+
label: 'Body',
|
|
91
|
+
description: 'The message body',
|
|
92
|
+
type: 'text'
|
|
93
|
+
},
|
|
94
|
+
bodyUrl: {
|
|
95
|
+
label: 'Body URL',
|
|
96
|
+
description: 'URL to the message body',
|
|
97
|
+
type: 'text'
|
|
98
|
+
},
|
|
99
|
+
bodyType: {
|
|
100
|
+
label: 'Body Type',
|
|
101
|
+
description: 'The type of body which is used generally html | design',
|
|
102
|
+
type: 'string',
|
|
103
|
+
required: true
|
|
104
|
+
},
|
|
105
|
+
bodyHtml: {
|
|
106
|
+
label: 'Body Html',
|
|
107
|
+
description: 'The HTML content of the body',
|
|
108
|
+
type: 'string'
|
|
109
|
+
},
|
|
110
|
+
groupId: {
|
|
111
|
+
label: 'Group ID',
|
|
112
|
+
description: 'Subscription group ID',
|
|
113
|
+
type: 'string'
|
|
114
|
+
},
|
|
115
|
+
byPassSubscription: {
|
|
116
|
+
label: 'By Pass Subscription',
|
|
117
|
+
description: 'Send email without subscription check',
|
|
118
|
+
type: 'boolean',
|
|
119
|
+
default: false
|
|
120
|
+
},
|
|
121
|
+
apiLookups: {
|
|
122
|
+
label: 'API Lookups',
|
|
123
|
+
description: 'Any API lookup configs that are needed to send the template',
|
|
124
|
+
type: 'object',
|
|
125
|
+
multiple: true,
|
|
126
|
+
properties: previewApiLookup_1.apiLookupActionFields
|
|
127
|
+
},
|
|
128
|
+
externalIds: {
|
|
129
|
+
label: 'External IDs',
|
|
130
|
+
description: 'An array of user profile identity information.',
|
|
131
|
+
type: 'object',
|
|
132
|
+
multiple: true,
|
|
133
|
+
properties: {
|
|
134
|
+
id: {
|
|
135
|
+
label: 'ID',
|
|
136
|
+
description: 'A unique identifier for the collection.',
|
|
137
|
+
type: 'string'
|
|
138
|
+
},
|
|
139
|
+
type: {
|
|
140
|
+
label: 'type',
|
|
141
|
+
description: 'The external ID contact type.',
|
|
142
|
+
type: 'string'
|
|
143
|
+
},
|
|
144
|
+
subscriptionStatus: {
|
|
145
|
+
label: 'subscriptionStatus',
|
|
146
|
+
description: 'The subscription status for the identity.',
|
|
147
|
+
type: 'string'
|
|
148
|
+
},
|
|
149
|
+
unsubscribeLink: {
|
|
150
|
+
label: 'unsubscribeLink',
|
|
151
|
+
description: 'Unsubscribe link for the end user',
|
|
152
|
+
type: 'string'
|
|
153
|
+
},
|
|
154
|
+
preferencesLink: {
|
|
155
|
+
label: 'preferencesLink',
|
|
156
|
+
description: 'Preferences link for the end user',
|
|
157
|
+
type: 'string'
|
|
158
|
+
},
|
|
159
|
+
groups: {
|
|
160
|
+
label: 'Subscription Groups',
|
|
161
|
+
description: 'Subscription groups and their statuses for this id.',
|
|
162
|
+
type: 'object',
|
|
163
|
+
multiple: true,
|
|
164
|
+
properties: {
|
|
165
|
+
id: {
|
|
166
|
+
label: 'Subscription group id',
|
|
167
|
+
type: 'string'
|
|
168
|
+
},
|
|
169
|
+
isSubscribed: {
|
|
170
|
+
label: 'status',
|
|
171
|
+
description: 'Group subscription status true is subscribed, false is unsubscribed or did-not-subscribe',
|
|
172
|
+
type: 'boolean'
|
|
173
|
+
},
|
|
174
|
+
groupUnsubscribeLink: {
|
|
175
|
+
label: 'groupUnsubscribeLink',
|
|
176
|
+
description: 'Group unsubscribe link for the end user',
|
|
177
|
+
type: 'string'
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
default: {
|
|
183
|
+
'@arrayPath': [
|
|
184
|
+
'$.external_ids',
|
|
185
|
+
{
|
|
186
|
+
id: {
|
|
187
|
+
'@path': '$.id'
|
|
188
|
+
},
|
|
189
|
+
type: {
|
|
190
|
+
'@path': '$.type'
|
|
191
|
+
},
|
|
192
|
+
subscriptionStatus: {
|
|
193
|
+
'@path': '$.isSubscribed'
|
|
194
|
+
},
|
|
195
|
+
unsubscribeLink: {
|
|
196
|
+
'@path': '$.unsubscribeLink'
|
|
197
|
+
},
|
|
198
|
+
preferencesLink: {
|
|
199
|
+
'@path': '$.preferencesLink'
|
|
200
|
+
},
|
|
201
|
+
groups: {
|
|
202
|
+
'@path': '$.groups'
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
customArgs: {
|
|
209
|
+
label: 'Custom Args',
|
|
210
|
+
description: 'Additional custom args that we be passed back opaquely on webhook events',
|
|
211
|
+
type: 'object',
|
|
212
|
+
required: false
|
|
213
|
+
},
|
|
214
|
+
traits: {
|
|
215
|
+
label: 'Traits',
|
|
216
|
+
description: "A user profile's traits",
|
|
217
|
+
type: 'object',
|
|
218
|
+
required: false,
|
|
219
|
+
default: { '@path': '$.properties' }
|
|
220
|
+
},
|
|
221
|
+
eventOccurredTS: {
|
|
222
|
+
label: 'Event Timestamp',
|
|
223
|
+
description: 'Time of when the actual event happened.',
|
|
224
|
+
type: 'string',
|
|
225
|
+
required: false,
|
|
226
|
+
default: {
|
|
227
|
+
'@path': '$.timestamp'
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
perform: async (request, executeInput) => {
|
|
232
|
+
const performer = new SendEmailPerformer_1.SendEmailPerformer(request, executeInput);
|
|
233
|
+
return performer.perform();
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
//# sourceMappingURL=actionDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionDefinition.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/sendEmail/actionDefinition.ts"],"names":[],"mappings":";;;AAGA,0DAA2D;AAC3D,6DAAyD;AAE5C,QAAA,gBAAgB,GAAwC;IACnE,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,2CAA2C;IACxD,mBAAmB,EAAE,+C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,OAAO,EAAE,gBAAgB;yBAC1B;wBACD,eAAe,EAAE;4BACf,OAAO,EAAE,mBAAmB;yBAC7B;wBACD,eAAe,EAAE;4BACf,OAAO,EAAE,mBAAmB;yBAC7B;wBACD,MAAM,EAAE;4BACN,OAAO,EAAE,UAAU;yBACpB;qBACF;iBACF;aACF;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,0EAA0E;YACvF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;QACD,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE;QACvC,MAAM,SAAS,GAAG,IAAI,uCAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;QAC/D,OAAO,SAAS,CAAC,OAAO,EAAE,CAAA;IAC5B,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../engage-messaging-sendgrid/sendEmail.types';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("../../../engage-messaging-sendgrid/sendEmail.types"), exports);
|
|
14
|
+
//# sourceMappingURL=generated-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/sendEmail/generated-types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qFAAkE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './actionDefinition';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./actionDefinition"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/sendEmail/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function insertEmailPreviewText(html: string, previewText: string): string;
|