Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contactslist - managecontact : name & properties not saved #267

Open
vwasteels opened this issue Dec 5, 2023 · 1 comment
Open

contactslist - managecontact : name & properties not saved #267

vwasteels opened this issue Dec 5, 2023 · 1 comment

Comments

@vwasteels
Copy link

Hello there,

This is my request :

const mjSubscription = await mailjet
.post("contactslist", {'version': 'v3'})
.id(process.env.MJ_CONTACT_LIST_ID)
.action("managecontact")
.request({
	"Name": user.first_name + ' ' + user.last_name,
	"Properties": JSON.stringify({
		"first_name": user.first_name,
		"last_name": user.last_name,
		"contakt_id": user.id,
		"employer_id": user.employer,
	}),
	"Action": "addnoforce",
	"Email": user.email,
});

const mjContact = mjSubscription.body.Data[0];
console.log(mjContact);

The properties are correctly set in Mailjet
Capture d’écran 2023-12-05 à 10 57 25

But the Properties and the Name are not set in Mailjet

Any idea why ?

Thank you
Vincent

@Bartiff
Copy link

Bartiff commented Feb 2, 2024

I have the same problem, @vwasteels did you find a solution?

EDIT: After several tests, I observe that it works well. You should not use JSON.stringify. An object is indeed expected for Properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants