PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, September 6, 2022

[FIXED] How do I pass a HTTP Post/Patch through a URL in an Email?

 September 06, 2022     api, email, http-headers, mailchimp-api-v3.0     No comments   

Issue

I just got done talking with tech support at MailChimp and they did say that it's possible to pass a http header through a url link. I've attached the transcript below for reference. I'm trying to learn how to use APIs and would appreciate some direction.


(11:22:40 PM) LG: I want to eliminate 3 steps in the UX. Currently, Someone would click on a link to update their profile, then select a radio button indicating a group/interest, then click submit. I'm wanting to accomplish that same action with individually programmed buttons within the email. So, if I had an image linked that graphically said "Student" and they clicked it, then they would be added to the student group/interest without having to leave the email.

(11:24:06 PM) LG: I've already accomplished one item with Randall, him and his associates showed me how to start a workflow when someone joins a group.

(11:24:15 PM) LG: and thanks!

(11:25:32 PM) Arthur: Thinking through this

(11:27:14 PM) LG: I'm not super familiar with APIs but I figured out that there might be potential to POST to lists/######/interest-categories/######/interests/###### via the API. I'm not sure if it's possible to do via an html src link.

(11:28:58 PM) LG: because, you could mailmerge that link with the user id to tie it in.

(11:32:18 PM) Arthur: If you're looking to do this with API, then I can direct you to this: [link prevented by lack of stack overflow reputation] One other option is to do a simple poll. You could have the names of different groups and people who click on those groups can be manually added by you into the group: [link prevented by lack of stack overflow reputation]

(11:34:21 PM) LG: Yeah, I've read that API document. Do you know if what I mentioned is possible?

(11:35:09 PM) Arthur: I can't say for certain, I'd get with a developer for more indepth information about the API.

(11:35:24 PM) LG: Yeah, can you connect me with a developer?

(11:35:53 PM) Arthur: We have a host of experts here in our directory that will be qualified to assist you with this: [link prevented by lack of stack overflow reputation]

(11:36:09 PM) LG: They work with mailchimp tech support?

(11:36:21 PM) Arthur: Can you clarify that for me?

(11:37:03 PM) LG: Are you offering me an outside referral to a third party or to escalate to a developer that works at mailchimp that can answer my question?

(11:38:33 PM) Arthur: Our directory is an outside referral as custom making an API is outside the scope of what we offer at MailChimp Tech Support.

(11:39:17 PM) LG: I'm not asking for custom development from you though. I'm asking if it's technically possible to do what I'm asking using your API.

(11:39:40 PM) LG: You don't offer support for your API?

(11:41:33 PM) Arthur: Okay I did some digging and it looks like it IS possible, but would require a good deal of custom code :)

(11:42:02 PM) LG: Cool, so it would work within mailchimp's email system as well?

(11:42:04 PM) Arthur: The email address or contact id could be passed in the URL and the server they link to could then make the required call

(11:42:24 PM) LG: cool

(11:42:34 PM) LG: that is what I needed to confirm.

(11:43:12 PM) Arthur: No problem.

(11:44:24 PM) LG: Can you link where you saw that?

(11:44:32 PM) LG: I just did a quick search and found this: Is it possible to pass HTTP headers in the URL itself?

(11:45:37 PM) Arthur: It was something I discussed with with colleague so there wouldn't be any documentation.

(11:45:53 PM) LG: ok thanks

(11:46:32 PM) LG: Well, I guess we are done here!

(11:46:43 PM) LG: Thanks for your help Arthur.

(11:47:12 PM) Arthur: I would recommend reaching out to our Experts directory for assistance on implementing that type of goal. They would have the expertise to accomplish that goal.

(11:49:36 PM) * Arthur left the chat *


Solution

Like the question you linked says, it's not possible to do this. Even if it were possible, it would compromise your private API key by being visible in the URL.

What the MailChimp representative is suggesting is that you pass the subscriber's email address through the URL (which can be done with a merge tag).

You'd then be able to retrieve the GET values on your server and process the subscriber's selection using the API. So the parameters at the end of your link could look something like this:

?email=*|EMAIL|*&choice=student

If you're managing multiple lists, you could also include the *|LIST:UID|* merge tag in the URL to indicate which list the preferences are being applied to.

This would still accomplish what you're trying to do, as the subscriber would only need to click the button in an email. The interest group would be applied without the extra step of loading a preferences page.



Answered By - Joel H.
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing