5

Your regExmatch function is just going to return the match (in rendered HTML in your case), not do the replacements. Your pattern looks fine. %%[ set @regEx = "<(.*?)>" set @str = "Hello, Chris John,<br><br>John Doe(CP Admin), an assister from Kentucky, is requesting access to your information, including resources, benefits,...


4

You can fetch the content of the personalised email, retrieving it from VAWP URL, using following code: %%[ IF _messagecontext == "SEND" AND jobid > 0 THEN set @HTML = HTTPGet(view_email_url) InsertDE("EmailStorage", "JobID",jobid, "SubscriberKey",_subscriberkey, "EventDate",NOW(), "HTML",@HTML )...


4

You can use LookupRows in combination with RowCount, like this: set @today = Format(Now(),"yyyy-MM-dd") set @rows = LookupRows("DataExtension","Date", @today) set @rowCount = rowcount(@rows) if @rowCount > 1 then set @Subject= "Hello" else set @Subject = "Thank You" endif


3

You need to concat it, like this: set @profilecenter = concat(profile_center_url,'&s=&c=&l=&ee=t&e=',SHA256(LOWERCASE(TRIM(emailaddr)))) When using it in the href, remember to use redirectTo: <a href="%%=RedirectTo(@profilecenter)=%%">Your profile</a>


3

I'd recommend defensively checking your rowcount before attempting to pull values from the results. Also, I try to use the emailaddr system string if I need the email address. It's safer to use in an email send context. %%[ var @email, @lookup, @CaseRow, @Name, @EmailID Set @email = AttributeValue("emailaddr") Set @lookup = ...


3

It is not technically possible to replace/update text content in an email after it has been sent. The examples shown e.g. here: How to refer Javascript cloud page in my email in content builder? and or here: Real time dynamic emails all rely on images, that are fetched at open. But the referencing URLs remain the same once the email has been generated and ...


3

You're not retrieving any rows from the Data Extension you've initialized, so there's nothing to loop around. See the top of the SSJS Core code below for an example of getting "data" from your Data Extension that you could iterate through. If this is part of something you're doing regularly, although you can do this with WSProxy, I'd recommend ...


2

I think what you are outputting is correct in what is coded, but that is not the output you actually intended to code for. I am assuming you just want the output to be once per label/value combination. To achieve that, I would adjust your code to include some conditionals to only output on even iterative numbers and to clear the label/value after output. ...


2

I think you’re missing RequestParameter for all your checkboxes - you’re not setting them anywhere in your script, that’s why they are neither interpreted as true nor false and the else condition is evaluated. Depending on what they are called in the form, you need to get their values first before evaluating them: If RequestParameter("submitted") ==...


2

Great question. There are a few different approaches, but I'd recommend building a rowset, then looping through the rowset to build the output. The following code will do exactly this. Here are some example outputs based on the consent values: email@email.com is subscribed to receive emails from Y email@email.com is subscribed to receive emails from Y and Z ...


2

I would recommend doing it like below instead: %%[ SET @now = now() SET @newDate = DATEADD(@now,1,"M") SET @nextMonth = DatePart(@newDate,"M") SET @day = 1 SET @year = DatePart(@newDate,"Y") SET @newFirstDate = DateParse(CONCAT(@year,'-',@nextMonth,'-',@day)) SET @expireDate = DATEADD(@newFirstDate,-1,"D") ]%% %%=v(@...


2

You can add a conditional statement in AMPscript: %%[IF NOT EMPTY(@imageUrls1) THEN]%% <table width="100%" cellspacing="0" cellpadding="0" role="presentation"> <tr><td align="center"> <img data-assetid="4855" src="%%=v(@imageUrls1)=%%" alt="" height="...


2

Upon Submit, you would have it go to a processing page that you would then use the AMPScript function RequestParameter to gather the information into a variable. From there you would then push it into the DE using UpsertDE or similar function (Insert,Update,etc...). One note is that you will need to name it so you can retrieve it easier. So let's say you ...


2

I'm assuming your @brand value is the value you are pulling from the sendable DE? If thats the case you haven't set the @brand variable with the value from the DE. Add this in the beginning SET @Brand = Brand Also missing closing " after each offerimage


1

You can use lookuprows() function to identify the subscriber in data extension B where you have the subscriber stored for receiving an email with Content B. Im assuming you are using data extension A to send out an email. %%[ SET @delookup = LOOKUPROWS("DataExtensionB","SubscriberKey", _SubscriberKey) IF ROWCOUNT(@delookup) != 0 ...


1

There are three potential error sources: a) the form. - Please include your form page's code. b) your code - which you could remove the spurious spaces from. c) your DE - information about this can help as well. Go through it from a to c. To isolate the behavior, simplify everything to text fields first. a) Are you sending the input from the form correctly? ...


1

var json = Platform.Function.ParseJSON(jsonVariable); if (json) { var coupon = json.coupon; for(var j = 0; j < coupon.length; j++) { var barCode = coupon[j][barcode]; var serialNumber = coupon[j][serialNumber]; var couponid = Platform.Function.GUID(); // and so forth //Assuming you don't have any coupon id in ...


1

I am assuming 'ContactId' is a field in your DE. It should be: %%[ var @opportunityName, @opportunityCloseDate set @subscriberid = _subscriberkey set @opportunityName = Lookup("Opportunities","Name","ContactId", @subscriberid) set @opportunityCloseDate = Lookup("Opportunities","CloseDate&...


1

If I understand correctly, this is what happens: A Lead enters a CloudPage, they fill out the form and submit On submission, a Salesforce Lead is created and at this point, you want to trigger an email? If yes, you can do so by using a Triggered Send. You place the script right after the CreateSalesforceObject() function and use the Lead ID returned from ...


1

It is possible. You need to ensure two things: Firstly. The integration user in Marketing Cloud needs to have access to all the Business Units where you want to use this feature. Click on "Manage Business Units" when selecting the user you use for integration, e.g.: Make sure they are all ticked: Secondly, you need to enable the integration to ...


1

The problem is evidently due to when you make a change to the email in Content Builder, the changes aren't reflected on the Transactional Message (much like needing to republish a triggered send definition). So, the solution was to edit the email within the Journey and saving. The Journey was never using the most recent email version.


1

Although the documentation says it's possible to add Smart Capture Form Actions, I wasn't able to find that option anywhere. UPDATE: Seems above is outdated, as it only works with Smart Capture in classic content view in Marketing Cloud Email Studio. As a workaround, I'd suggest using Journey Builder. When you create your SmartCapture form, check the box ...


1

You can use single quotes around your XML, so: set @xml = '<root><listing bedrooms="3" bathrooms="2.0" /><listing bedrooms="" bathrooms=""/></root>' Or you can use use two double-quotes, so: set @xml = "<root><listing bedrooms=""3"" bathrooms=""2.0&...


1

your FOR line has to be changed to: FOR @i = 1 TO ROWCOUNT(@PeriodRows) DO


1

If I understand correctly, you are posting parameters to the form page itself. And upon reload of the page you want to prefill values which you have retrieved through RequestParameter(). In this case, you don't need a data extension lookup. You can just display the variable value in the html input element using value attribute in combination with using ...


1

I believe the issue is because in your HTTPPost2 function itself. Based on the documentation the parameters are as followed: Please pay attention to parameter 5 and 6 in your code: SET @req = HTTPPost2(@url, "application/json", @payload, false, "Authorization", @auth, @response) You have moved your @response variable to #7 The correct ...


1

I've spent some time trying to figure out why @David's script is errored even if the AMPScript code is validated on a CloudPage. Turns out it does work with Classic Content only (which already retired) and not with Content Builder. So, to save you some time, try this code instead: <script runat="server"> var stream = Platform.Function....


Only top voted, non community-wiki answers of a minimum length are eligible