Mailchimp: Retrieve all newstletter/lists from one member - mailchimp

Hi is it possible in Mailchimp, with one call to retrieve all lists where a member is subscribed to?

In our organization we have multiple newsletter lsts, I would like to retrieve all subscription with one mailchimp call and not individual calls like:
https://us3.api.mailchimp.com/3.0/lists/[newsletter 1]/members/[email]
https://us3.api.mailchimp.com/3.0/lists/[newsletter 2]/members/[email]
https://us3.api.mailchimp.com/3.0/lists/[newsletter 3]/members/[email]

Related

Set the FROM name of a mailinglist list in mailman3

Iam using mailman3 and I just want to set a FROM name for my lists. Currently the FROM for lists for example the welcome mail etc. is just the mailaddress like LISTNAME#lists.example.com but I would like to have it like My List <listname#lists.example.com>. I could not find the correct setting here:
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/config/docs/config.html#schema-cfg
to achieve that and hope there is a solution for that
The mailing list display name is not used when sending service emails (like the welcome email). Also, they are being sent from addresses like listname-request#lists.example.com rather than from the main list's address.
Certain emails like (un)subscription notifications might be sent from an email defined in the site-owner parameter, but they are for list owners, not regular members.

Get Recent Campaign Sends from Mailchimp API

I'm trying to pull the latest sends from all my campaigns in Mailchimp via the 3.0 API. The only way I seem to be able to do this is:
1) Search for a given member by email
/3.0/search-members?query=joe#example.com
2) Get the member ID and request their activity
3.0/lists/{LIST ID}/members/{USER ID}/activity
3) Pull the content of the email in their activity feed:
3.0/campaigns/{CAMPAIGN ID}/content
The problem with this is that I need to know the user's email in advance and then search by each user individually, meaning many wasted of API calls.
Is there an endpoint for campaigns that I can request the last sends for a given date range?
The /campaigns endpoint returns campaigns for a given list and each returned object does include a recipients property.
You may also want to checkout:
/search-campaigns
And:
/reports/{campaign_id}/sent-to

Grails - How to modify list items from g:select dynamically

I have a domain class called Client with typical attributes (name, surname, and so on).
There's also a class called PaymentConditions (which establishes some parameters to calculate the amount that a client has to pay) which have a reference to Client. A Client can have many PaymentConditions.
And finally there's a Payment class with attributes like paymentDate, amount and a reference to Client and PaymentConditions.
When I want to register a Payment I use an Ajax call to retrieve data from the Client (including the client id) that is making the payment. But the problem is that because of the reference to PaymentConditions there's a drop-down list with all the payment conditions registered. What I need is to filter the drop-down list items to show only the ones that are related to the retrieved client.
Can you help me with this?
Thanks in advance!
EDITED: There's an input field in the form where the user has to enter the Client's surname. This input field has implemented the JQuery UI autocomplete feature, so when a Client is selected the PaymentConditions drop-down list must be updated or filtered for the retrieved Client.
For showing dropdown list grails provides a special select tag-
<g:select name="paymentCondition" //Name you want to send back to server
from="${client.paymentConditions}" //Client wise filtered conditions where client is a passed client instance
value="${client.paymentConditions.id}" //Selected option value to send to server
/>
Or if you want to filter the list out in controller only then you can do-
def client = Client.get(id);
def paymentConditions = client.paymentConditions
Use the way you like according to your implementation. Hope it helps.

Mailchimp subscription metadata

Is it possible to add metadata to user mailchimp subscription?
This is my mailchimp method for subscription :
def subscribe_to_newsletter
MAILCHIMP.listSubscribe(id: MAILCHIMP_LIST_ID,
email_address: email,
double_optin: false,
merge_vars: {FNAME:firstname,LNAME:surname})
end
I'm wondering can I put some metadata like some unique property for the object being subscribed, or the property being common for more than one object?
Or is there a way to do this mailchimp way?
You can define new merge_vars using listMergeVarAdd. Once you've done that you can include them in the listSubscribe merge_vars.

Is it possible to use nested merge tags in Mandrill?

Is it possible to use nested merge tags?
What we need is to be able to define the UNSUB tag depending on the values from other merge tags, like on this example:
<a
href="*|UNSUB:*|COMMUNITYURL|*/site/unsuscribe/user_id/*|USERID|*/hash/*|HASH|*/type/all|*">
Unsubscribe
</a>
Is this correct?
Should be done in a different way?
It's not currently possible to nest merge tags. In this case, your best bet would be to add your own List-Unsubscribe headers (using the headers parameter in the API) and pass either your own URL, or a URL constructed with your merge tags but not the UNSUB merge tag.
From the API:
What happens when the [unsubscribe] link is clicked?
If a recipient clicks the generated link, the message status is changed to Unsubscribed and > the recipient's address is added to the Rejection Blacklist in your
Mandrill account. The redirect URL will be appended to include two
querystring parameters that can be used for processing the unsubscribe
in your own system or database:
md_id - the _id, as provided in the API call and webhooks of the
specific message where the unsubscribe link was clicked
md_email - a URL-encoded version of the recipient's email address
So you don't have to worry about generating an unsubscribe url for every user. Just put a generic url and mandrill automatically will append to you the email of that user in the md_email variable.
The documentation suggest that you do this then:
Click here to unsubscribe.
And mandrill will append the correct user email and id:
http://mywebsite.com/unsub?md_email=fulanito#gmail.com&m_id=23321
Since mandrill doesn't support nested merge tags, here is the solution for the case like yours if you dont mind after user click unsub, it did't go to mandrill's black list, since the unsubsription are all handled by your app.
PER YOUR CASE:
Manually compose your unsubscribe link
e.g.
*|COMMUNITYURL|*/site/unsuscribe/user_id/*|USERID|*/hash/*|HASH|*/type/all/
At the end of your link, append the mandrill recipient email var.email=*|EMAIL|* e.g.
*|COMMUNITYURL|*/site/unsuscribe/user_id/*|USERID|*/hash/*|HASH|*/type/all/?email=*|EMAIL|*
Put the link to your mandrill template
Unsubscribe Me
reference: mandrill doc

Resources