Skip to content

Commit

Permalink
chore(release): pull hotfix-release/v1.74.1 into main (#3643)
Browse files Browse the repository at this point in the history
  • Loading branch information
aashishmalik authored Aug 8, 2024
2 parents 7e27e3a + 2b77ac4 commit 8bbb7fb
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.74.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.74.0...v1.74.1) (2024-08-08)


### Bug Fixes

* sendgrid read root traits ([#3642](https://github.com/rudderlabs/rudder-transformer/issues/3642)) ([5acad70](https://github.com/rudderlabs/rudder-transformer/commit/5acad707d3125f3d50380d886f5fecb1406836cd))

## [1.74.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.73.1...v1.74.0) (2024-08-05)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudder-transformer",
"version": "1.74.0",
"version": "1.74.1",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion src/v0/destinations/sendgrid/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ const fetchCustomFields = async ({ destination, metadata }) => {
*/
const getCustomFields = async ({ message, destination, metadata }) => {
const customFields = {};
const payload = get(message, 'context.traits');
const payload = get(message, 'context.traits') || get(message, 'traits');
const { customFieldsMapping } = destination.Config;
const fieldsMapping = getHashFromArray(customFieldsMapping, 'from', 'to', false);
const fields = Object.keys(fieldsMapping);
Expand Down
133 changes: 133 additions & 0 deletions test/integrations/destinations/sendgrid/processor/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1541,4 +1541,137 @@ export const data = [
},
},
},
{
name: 'sendgrid',
description: 'Identify call traits at root and listId given',
feature: 'processor',
module: 'destination',
version: 'v0',
input: {
request: {
body: [
{
destination: {
ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
Config: {
IPPoolName: '',
apiKey: 'apikey',
attachments: [
{
content: '',
contentId: '',
disposition: '',
filename: '',
type: '',
},
],
clickTracking: true,
listId: 'list123',
clickTrackingEnableText: true,
contents: [
{
type: 'text/html',
value:
'<p>Hello from Twilio SendGrid!</p><p>Sending with the email service trusted by developers and marketers for <strong>time-savings</strong>, <strong>scalability</strong>, and <strong>delivery expertise</strong>.</p><p>%open-track%</p>',
},
],
customFieldsMapping: [
{
from: 'name',
to: 'user_name',
},
],
eventDelivery: false,
eventDeliveryTS: 1668424218224,
eventNamesSettings: [
{
event: 'open',
},
],
footer: false,
fromEmail: '[email protected]',
fromName: '',
ganalytics: false,
group: '',
groupsToDisplay: [
{
groupId: '',
},
],
html: '',
mailFromTraits: false,
openTracking: false,
openTrackingSubstitutionTag: '',
replyToEmail: '',
replyToName: '',
sandboxMode: false,
subject: 'hello there from webflow',
subscriptionTracking: false,
substitutionTag: '',
templateId: '',
text: '',
},
},
message: {
type: 'identify',
userId: 'user@1',
context: {
traits: {
age: '25',
city: 'Surat',
name: 'rudder test',
email: '[email protected]',
phone: '+91 9876543210',
lastName: 'test',
firstName: 'rudder',
state: 'Gujarat',
},
},
},
},
],
},
},
output: {
response: {
status: 200,
body: [
{
output: {
body: {
XML: {},
FORM: {},
JSON: {
contactDetails: {
email: '[email protected]',
last_name: 'test',
first_name: 'rudder',
unique_name: 'rudder test',
phone_number: '+91 9876543210',
custom_fields: {
w1_T: 'rudder test',
},
},
contactListIds: 'list123',
},
JSON_ARRAY: {},
},
type: 'REST',
userId: '',
files: {},
method: 'PUT',
params: {},
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer apikey',
},
version: '1',
endpoint: 'https://api.sendgrid.com/v3/marketing/contacts',
},
statusCode: 200,
},
],
},
},
},
];

0 comments on commit 8bbb7fb

Please sign in to comment.