One possibility would be including an Exclusion Script in the email that filters out subscribers present in the sent data view with a date of the current day or in your second case the last 7 days.
According to Eliot's answer to another question the script needs to be saved to a content block and the return value (content) of this block needs to be used in the Exclusion script:
%%[
var @test
set @test = DateDiff(iif(RowCount(LookupOrderedRows('_Sent',1,'EventDate desc','SubscriberKey',_subscriberKey))==1,Field(Row(LookupOrderedRows('_Sent',1,'EventDate desc','SubscriberKey',_subscriberKey),1),'EventDate'),'1/1/2000'),SystemDateToLocalDate(Now()),'D')
]%%
%%=v(@test)=%%
And your exclusion script will look like this (for the 7 day check):
TreatAsContent(ContentBlockbyID('[ID_OF_YOUR_CONTENT_BLOCK]')) < 7
Related documentation:
I made some investigation and think that to create/update Automation using REST, it is needed to use .json payload in this format:
{
"id": "e906af34-4a19-42e9-9ce2-ac6413a77a09",
"legacyId": "X0p0TVdZSUxWZ09sVEV0dlJiTk5CUToyNTow",
"name": "Maciej_testAut_20190513_1721",
"description": "ddddd",
"key": "Maciej_testAut_20190513_1721",
"categoryId": 409,
"statusId": 4,
"lastSavedDate": "2019-05-13T07:43:59.137",
"lastSavedByName": "Maciej Barnas",
"createdDate": "2019-05-13T06:27:06.597",
"createdByName": "DEV integration for Metadata Tool - v2 app user",
"updateInProgress": false,
"steps": [
{
"annotation": "",
"stepNumber": 0,
"activities": [
{
"id": "9ba08e57-57b8-4485-b219-e1ddfd6e6019",
"name": "Maciej_testQuery_2",
"description": "",
"activityObjectId": "fb0533a4-a7d5-4579-a766-cd7e4b047e74",
"objectTypeId": 300,
"displayOrder": 0,
"serializedObject": ""
}
]
},
{
"annotation": "",
"stepNumber": 1,
"activities": [
{
"id": "b5cfb339-52b1-45a7-a75e-c20ac8fdecdf",
"name": "Maciej_testQuery_1",
"description": "",
"activityObjectId": "51f05855-88a9-403c-a3b0-d4b42ac7db91",
"objectTypeId": 300,
"displayOrder": 0,
"serializedObject": ""
}
]
}
],
"startSource": {
"typeId": 1,
"schedule": {
"scheduleTypeId": 2,
"startDate": "2019-05-13T16:00:00",
"endDate": "2019-05-13T16:00:00",
"rangeTypeId": 0,
"occurrences": 1,
"icalRecur": "FREQ=HOURLY;COUNT=1;INTERVAL=1",
"timezoneId": 5,
"statusId": 0
}
}
}
To create use POST, to update use PATCH. The endpoints are the same as I noticed in my question.
But as you can see the format, which you can retrieve using GET with the endpoint:
https://{{tenant}}.rest.marketingcloudapis.com/automation/v1/automations/{{id}}
contains e.g. "schedule" and "steps" part is different. But to create/update we need to have "startSource" and "steps" in other way.
Best Answer
Kelly was almost right here - it is actually the time that is the problem.
When selecting from the drop down list for the time (in my case at least), I have the choice of 0:00 - 23:30 (24hr format) and the text then displays as so when selected in the drop down.
The time however needs to be in 12 hour format e.g. '13:30' needs to be '1:30 PM' - so using the drop-down is pointless for us right now.
I have reported the bug to ET, but for the time being this is the solution that our marketers are having to use.