4
This is the order of operations:
Order of Operations
AMPscript processes functions in this order:
1 HTML Body
2 Text Body
3 Subject Line
Any preheader values reside
at the beginning of the body and process accordingly.
Source: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/...
3
You should use AttributeValue() function, to grab the value of LastLoggedInDate and LastEmailOpenedDate from the data extension:
SET @LastLoggedInDate = AttributeValue("LastLoggedInDate")
SET @LastEmailOpenedDate = AttributeValue("LastEmailOpenedDate")
IF @Campaign == "Newsletter" THEN
IF (@LastLoggedInDate < DateAdd(Now(), ...
2
The Reference block is nearly 100% identical to the AMPscript ContentBlockByID. This can be verified because if you look at a preview of the email outside the editor (properties tab), it shows %%=CONTENTBLOCKBYID('12345')=%% in the Reference Block position.
The main differences are:
You do not get control over the other optional parameters ContentBlockByID()...
1
See Salesforce's documentation on this.
If you're updating AMPscript, the documentation states that you need to pause and republish its associated triggered send via Interactions > Triggered Sends > Journey Builder Sends. Once you've updated your email, do the following:
Navigate to Interactions > Triggered Emails > Journey Builder Sends, to ...
1
It looks as though replacing the shorthand opening/closing tags (%%[ ]%%) with the longform does fix the issue for some strange reason.
This is within the context of a Code Snippet block in the email editor.
<script runat=server language=ampscript>
SET @i = 0
SET @text = "You are <0>amazing</0>."
SET @closeTag = concat("</...
1
I took your code that "doesn't work", and it does indeed work.
copy / pasted example two (yes, I made sure) onto a cloudpage, added the AMPscript tags and wrote the output:
%%[
SET @i = 0
SET @text = "You are <0>amazing</0>."
SET @closeTag = concat("</", @i, ">")
SET @tag = @closeTag
SET @tagLen = ...
1
If you really need a real time notification, once a link has been clicked in an email, you can utilise the ENS which is a part of the new-ish Transactional Email feature of SFMC. The reason why I assume this is suitable for you, is the fact of you mentioning Triggered Sends:
The reason I want this functionality is to ensure that a user receives
the ...
1
I think you may be misunderstanding the purpose of the AttributeValue function. It's meant to retrieve and validate contextual variables.
You're also missing an opening block tag (%%[) before the first condition.
Assuming that @action should be @CardTierDesc, you could do something like this:
%%[
var @CardTierDesc
set @CardTierDesc = AttributeValue("...
1
There are few issues with your code:
You should prepend your variable names with "@", as this is the correct notation for variables. I assume you are fetching these numbers from your sendable data extension. In this case you should define your @OrderTotal using AttributeValue function, making your code more robust.
When comparing numbers, don't ...
1
You have a logical problem in your IF statement.
IF (@Product == "Electricity" AND @Product == "Broadband" (...)
this will never be true.
You might want:
IF (@Product == Electricity OR @Product == "Broadband)
AND @Status == "Pending"
THEN
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
ampscript × 2650marketing-cloud × 2526
email × 231
dataextensions × 229
ssjs × 212
cloudpage × 190
journeybuilder × 110
landing-page × 87
lookup × 69
marketing-cloud-connect × 66
content-builder × 66
mobileconnect × 65
api × 59
javascript × 56
html × 55
triggered-send × 47
email-template × 43
soap-api × 39
dynamic × 37
sms × 36
email-studio × 35
xml × 30
smart-capture × 27
gtl × 27
rest-api × 26