How can I use marketing email templates with an API request? - rest

I'm trying to set up an API request for Dynamics 365 to send an email template to a specific user, and I am having a lot of difficulty getting it to do what I want.
I'm using the SendEmailFromTemplate action and so far only have access to global templates. Whenever I try to use a marketing email template, it says it's not found. Is it even possible for me to use Marketing email templates with this action?
Response
"error": {
"code": "0x80040217",
"message": "template With Id = 41deb0fa-c108-eb11-a813-000d3a8c09cf Does Not Exist"
}
Additionally, I've not been able to embed user data in the global templates such as {{contact.address1_city}}.
Current request:
{
"TemplateId": "TEMPLATE-ID",
"Regarding": {
"contactid": "CONTACT-ID",
"#odata.type": "Microsoft.Dynamics.CRM.contact"
},
"Target": {
"regardingobjectid_contact#odata.bind": "/contacts(CONTACT-ID)",
"email_activity_parties": [{
"partyid_systemuser#odata.bind": "/systemusers(SYSTEMUSER-ID)",
"participationtypemask": 1
}, {
"partyid_contact#odata.bind": "/contacts(CONTACT-ID))",
"participationtypemask": 2
}],
"#odata.type": "Microsoft.Dynamics.CRM.email"
}
}
I might be going about it the wrong way. Any assistance is appreciated.
Thanks!

No this is not supported.
Marketing emails and CDS emails are two separate things - both business-wise and technically. Marketing emails are meant for sending emails in business to business and business to customer scenarios and are part of marketing solution. CDS emails are piece of core functionality.
If you do want to send marketing email your best shot is to use "quick send" instead.

Related

how to create a custom profile in salesforce using rest api

Am experimenting with salesforce apis by creating and patching with its api services.I dont know how to create a custom profile with the help of its apis and also i dont know what are all the required body parameters to create a profile. i tried sending a post request with the following body
{
"Name" : "testprofile"
}
to the url /services/data/v54.0/sobjects/Profile
i got this message as response
{
"message": "insufficient access rights on cross-reference id",
"errorCode": "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY",
"fields": []
}
i reffered https://developer.salesforce.com/docs/atlas.en-us.234.0.object_reference.meta/object_reference/sforce_api_objects_profile.htm
havent got any eloborate writings on what should be in the body while using post request.. but it says create() methods are allowed
It seems that i have to add user license with the body along with the name for the post to scceeded once added it should look like this
{
"Name":"profilename",
"UserLicenseId": "license id"
}
and thus made the request work

Unable to craete automated marketing email using Hubspot API

I'm unable to create automated email using Hubspot API.
As mentioned in the linked document below, there is an emailType parameter, but it always takes BATCH_EMAIL.
Any suggestion or help is appreciated.
https://legacydocs.hubspot.com/docs/methods/lists/marketing-email-overview
const email = {
"emailType": 'AUTOMATED_EMAIL',
"subcategory": "automated",
}

Skype Bot sending message (not a reply)

Trying to create a Skype Bot, but I have a problem. Please, help me.
I use PHP so I use REST (not NodeJS or C# SDK).
The task: I have to send data from html form on my website to Skype (so I don’t have to reply to a message, but just send).
Well, I have successfully create a bot in Microsoft Bot Framework.
Then I have successfully received an access_token.
Then they say in docs that I have to send a POST to:
/v3/conversations/{conversationId}/activities
According to https://learn.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-send-and-receive-messages I have to send a request to /v3/conversations with JSON like that:
{
"bot": {
"id": "12345678",
"name": "bot's name"
},
"isGroup": false,
"members": [
{
"id": "1234abcd",
"name": "recipient's name"
}
],
"topicName": "News Alert"
}
But what is the "member's id and member's name"?
To get the member ids of some members, add all those members in a group and add the bot, too, to the group and preferably send a message in the group, mentioning the bot. You will receive a json with a conversationId. With this conversationId, make a get request to v3/conversations/{conversationId}/members in order to receive the member-ids and member-names of the members in the group.
You can now proceed with these member-ids and member-names to start individual conversations with the members (which is illustrated in my answer to this question).

Auto create google groups from sheets

Searched the net, youtube, and google forums/documentation but can't seem to find this one even if it is possible.
I'm using a google form as a starting point for a workflow that then gets turned into a google group. Is there any scripts that can auto create a google group from the google forms output in sheets once form is submitted?
Thanks in advance.
I haven't tested this yet, so just give it a try. This is what I've found. Directory API let's you create a group by making a POST URI request:
https://www.googleapis.com/admin/directory/v1/groups
with request body:
{
"email": "sales_group#example.com",
"name": "Sales Group",
"description": "This is the Sales group."
}
Since you are using Google Forms, the option would be to use AppScript to perform the XHR request.
Try to make use of Class UrlFetchApp in Appscript.
var options =
{
"method" : "post",
"payload" : payload
};
UrlFetchApp.fetch("http://example.com/upload_form.cgi", options);

setting event organizer with Outlook Calendar REST API

I am using the Outlook REST API for creating events and sending its invitations, based on this documentation
I authenticate the logged in user, and send its Bearer token through the Authorization header of the request, and the json-formatted event on its content.
If I set the "Organizer" to another user rather than the authenticated one, as well as the "IsOrganizer" property to "false", it gets totally ignored and sets the current logged in user as the organizer.
Any clues of what could be happening?
Is there another way of doing this?
Thank you!
I'm posting this in case someone else finds and needs an answer for this scenario...
You (Account A) can create a calendar event as someone else (Account B) through Office365 REST APIs as long as the account has permission to send as the other user account.
Here are the steps:
1) Call the Office365 REST API as follows,where {{{user2email}}} is the user you want the event to be created as (Account B's email address):
https://outlook.office365.com/api/v1.0/users/{{{user2email}}}/calendar
This should return Account B's user's calendar ID.
2) Pass in your JSON - the following is an example of what I used during unit testing:
{
"Subject": "Test - Created using Office365 Calendar REST API should be from Technology Notice",
"IsOrganizer": "False",
"Body": {
"ContentType": "HTML",
"Content": "This is where body copy goes HTML supported"
},
"Start": "2015-12-11T19:00:00Z",
"End": "2015-12-11T20:00:00Z",
"Attendees": [
{
"EmailAddress": {
"Address": "attendee1#yourcompany.com",
"Name": "Attendee One"
},
"Type": "Required"
}
],
"Organizer": {
"EmailAddress": {
"Address": "tnotice#yourcompany.com",
"Name": "Technology Notice"
}
}
}
'Technology Notice' will be who the calendar invite is from.
3) Use the ID from step 2 in your POST request, for example:
https://outlook.office365.com/api/v1.0/users/{{{user2email}}}/calendars/{{{ID}}}/events
Note: Make sure you're sending the POST request as the authenticated user account (Account A) who's account the mailbox/calendar it actually belongs to.
If everything is right you should be able to send a calendar invite and have it show up as originating from Account B instead of Account A.
Hope this helps someone out.
This is the correct behavior. You cannot create an event on User A's calendar but set the organizer to User B.