Can we send multiple emails from survey monkey to same emailid - surveymonkey

I am using an Email collector for sending survey invitations. I am directly adding the recipients in the below way while sending the survey invitations. However, I have a situation to send multiple invitations to the recipient with same emailID. How can we send multiple invitations in that case? If I include multiple emailID's in the same request, survey monkey mark it as "duplicate" and only one email will be sent.
Can we send multiple emails from survey monkey to same emailid?
POST /collectors/{id}/messages/{id}/recipients/bulk
{
"contacts": [{
"email": "user1#example.com",
"first_name": "User 1",
"last_name": "Testing"
},{
"email": "user2#example.com",
"first_name": "User 2",
"last_name": "Testing"
},{
"email": "user1#example.com",
"first_name": "User 1",
"last_name": "Testing"
}]
}

You cannot send to the same email twice, as you said, it will show up as a duplicate and only send once.
I'm not really sure the use case for sending two messages to the same email at the exact same time, but if you want to send to the same email again, you need to create a new message on that collector and add the recipient to the new message.

Related

[twilio]: How to set Participant while sending message in twilio conversation and how to validate the Participant has permission to send message?

My requirement is forbid some participants not to send messages in conversation? how to achieve that?
I created a role as below and attached roleid to the coversation participant. So how to validate the participant not to send message in this conversation ?
{
"sid": "RL1XX",
"type": "CONVERSATION",
"permissions": [
"leaveConversation"
],
"url": "https://conversations.twilio.com/v1/Roles/RLXX",
"accountSid": "ACXX",
"chatServiceSid": "ISXX",
"friendlyName": "patient_basic",
"dateCreated": 1675238559.000000000,
"dateUpdated": 1675238559.000000000
}
How to implement role validations in twilio conversations?

Matching expressions for Twilio TaskRouter workers on data in objects in arrays

I've got Twilio Taskrouter workers with attributes that look like as follows:
{
"name": "Bob",
"id": "45",
"roles": [
{ "id": "19", "name": "Foobar" },
{ "id": "20", "name": "Foobaz" }
]
}
I'd like to write a queue expression to only match Workers with roles with an id of 20. How would I do that?
It would look something like...
"20" in roles.id
...but this doesn't work. As it seems Taskrouter is not smart enough to "unroll" the ids and match within them (like using a tool like jq). I am not able to find a solution in the Twilio Taskrouter expression docs.
Twilio developer evangelist here.
I can't find a solution for you with the data like that. A workaround I just considered would be to add an array of, for example, role_ids to your worker as well. You can keep the existing array of roles, but add a simpler data type to use in the expression matching.
So, the attributes would look like this:
{
"name": "Bob",
"id": "45",
"roles": [
{ "id": "19", "name": "Foobar" },
{ "id": "20", "name": "Foobaz" }
],
"role_ids": ["19", "20"]
}
And you could then use the expression:
"20" in role_ids

Uniqueness of a json

My app is receiving payload and I want to make sure it's recorded only once.
How can I create a uniqueness?
If the same publication is sent twice it shouldn't be saved.
payload example
{
"data": {
"type": "publication",
"attributes": {
"advert": {
"title": Super cat",
"description": "Some dummy text",
"customer": {
"name": "Mozart"
}
}
}
}
}
Finally found what expected
validates :customer, uniqueness: {scope: :title}
If you want to make sure your payload is unique and only saved once, then you need to assign a field in your model to be unique. From the JSON example you provide, and stating that the same publication shouldn't be saved twice, one option is to make the title unique.
Your question is tagged Ruby on Rails, so you could use the following in your model to enforce this:
validates :title, uniqueness: true
Unless you are provided with an ID (as mentioned in the comments) or some other independently unique identifier, you need to pick a field returned in the payload to check against.

searching emails in tire (elastic serach) not working

How to index emails in tire.
i want a full model search including email. The problem is example#gmail.com is not working in search as it as '#' character so it splits up.
this is my query
query { terms :_all, params[:query], :minimum_match => 10} if params[:query].present?
if i used "include_in_all: false" then how i can include email in query serach or how to send both _all and email in terms query
is there any workable solution to fully index email without splitting so that it can be included in _all.
tried 'tokenizer' => 'uax_url_email'? but not working . how to set it correctly in rails
Here's a gist of how to create an index with the _all field using the uax_url_email tokenizer.
Another solution would be to index the email field as not_analyzed.
"email": {
"type": "multi_field",
"fields": {
"email": {"type": "string", "index": "analyzed"},
"exact": {"type": "string","index": "not_analyzed"}
}
}
Querying on the "email.exact" term will return the exact email value, without splitting on the "#".

How do I create a user with no email address in Desire2Learn's Valence APIs?

If I want to create a new user through Desire2Learn's Valence API, but the user will not have an external email address, how must I provide the new user data?
When you create a new user, you must use the User.CreateUserData structure, and if you want the user to have no external email address, you have to provide a null value for the property:
{"UserName": "Test.User",
"FirstName": "Test",
"MiddleName": "",
"LastName": "User",
"RoleId": "103",
"OrgDefinedId": "ext-test-user",
"IsActive": true,
"ExternalEmail": null,
"SendCreationEmail": false}

Resources