Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] add method replaceReference to find&replace ampscript contentBlockByX with one of the other options #1270

Closed
JoernBerkefeld opened this issue Apr 18, 2024 · 1 comment · Fixed by #1353 or #1193
Assignees
Labels
enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story"
Milestone

Comments

@JoernBerkefeld
Copy link
Contributor

JoernBerkefeld commented Apr 18, 2024

has to cover AMPSCRIPT and SSJS
Platform.Function.ContentBlockByName('Activity_Creation_for_task');

test platform: https://regex101.com/#javascript

relevant types that could contain amscript:

  • script
  • journey (email related)
  • triggeredSend
  • asset (email, content blocks, ...)
  • senderProfile

regex:

  • ContentBlockByID: /ContentBlockById\(\s*"([0-9]+)"\s*\)/gmi & /ContentBlockById\(\s*'([0-9]+)'\s*\)/gmi

  • ContentBlockByKey: /ContentBlockByKey\(\s*"([a-z0-9-\/._]+)"\s*\)/gmi & /ContentBlockByKey\(\s*'([a-z0-9-\/._]+)'\s*\)/gmi

  • ContentBlockByName: /ContentBlockByName\(\s*"([ a-z0-9-\\._)(]+)"\s*\)/gmi & /ContentBlockByName\(\s*'([ a-z0-9-\\._)(]+)'\s*\)/gmi

test strings

  • ContentBlockByKey
// double quote

%%=contentblockbykey("abc123-/._abc123")=%%
%%=ContentBlockByKey("abc123-/._abc123")=%%
%%= ContentBlockByKey("abc123-/._abc123") =%%
%%= ContentBlockByKey( "abc123-/._abc123" ) =%%
%%= ContentBlockByKey( "abc123-/._abc123"  ) =%%
%%= ContentBlockByKey(  "abc123-/._abc123"  ) =%%

%%=contentblockbykey("0b76dccf-594c-b6dc-1acf-10c4493dcb84")=%%
%%=ContentBlockByKey("0b76dccf-594c-b6dc-1acf-10c4493dcb84")=%%
%%= ContentBlockByKey("0b76dccf-594c-b6dc-1acf-10c4493dcb84") =%%
%%= ContentBlockByKey( "0b76dccf-594c-b6dc-1acf-10c4493dcb84" ) =%%
%%= ContentBlockByKey( "0b76dccf-594c-b6dc-1acf-10c4493dcb84"  ) =%%
%%= ContentBlockByKey(  "0b76dccf-594c-b6dc-1acf-10c4493dcb84"  ) =%%

// single quote

%%=contentblockbykey('abc123-/._abc123')=%%
%%=ContentBlockByKey('abc123-/._abc123')=%%
%%= ContentBlockByKey('abc123-/._abc123') =%%
%%= ContentBlockByKey( 'abc123-/._abc123' ) =%%
%%= ContentBlockByKey( 'abc123-/._abc123'  ) =%%
%%= ContentBlockByKey(  'abc123-/._abc123'  ) =%%

%%=contentblockbykey('0b76dccf-594c-b6dc-1acf-10c4493dcb84')=%%
%%=ContentBlockByKey('0b76dccf-594c-b6dc-1acf-10c4493dcb84')=%%
%%= ContentBlockByKey('0b76dccf-594c-b6dc-1acf-10c4493dcb84') =%%
%%= ContentBlockByKey( '0b76dccf-594c-b6dc-1acf-10c4493dcb84' ) =%%
%%= ContentBlockByKey( '0b76dccf-594c-b6dc-1acf-10c4493dcb84'  ) =%%
%%= ContentBlockByKey(  '0b76dccf-594c-b6dc-1acf-10c4493dcb84'  ) =%%
  • ContentBlockById
// double quote

%%=contentblockbyid("1234")=%%
%%=ContentBlockById("1234")=%%
%%= ContentBlockById("1234") =%%
%%= ContentBlockById( "1234" ) =%%
%%= ContentBlockById( "1234"  ) =%%
%%= ContentBlockById(  "1234"  ) =%%

// single quote

%%=contentblockbyid('1234')=%%
%%=ContentBlockById('1234')=%%
%%= ContentBlockById('1234') =%%
%%= ContentBlockById( '1234' ) =%%
%%= ContentBlockById( '1234'  ) =%%
%%= ContentBlockById(  '1234'  ) =%%
  • ContentBlockByName
// double quote
%%=contentblockbyname("Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue")=%%
%%=ContentBlockByName("Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue")=%%
%%= ContentBlockByName("Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue") =%%
%%= ContentBlockByName( "Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue" ) =%%
%%= ContentBlockByName( "Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue"  ) =%%
%%= ContentBlockByName(  "Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue"  ) =%%

// single quote

%%=contentblockbyname('Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue')=%%
%%=ContentBlockByName('Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue')=%%
%%= ContentBlockByName('Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue') =%%
%%= ContentBlockByName( 'Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue' ) =%%
%%= ContentBlockByName( 'Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue'  ) =%%
%%= ContentBlockByName(  'Content Builder\Release 2 - BUILD\Content Blocks Library\NEW\03. Header and banner\Referred contentblock\RS_Dev_Header_blue'  ) =%%
@JoernBerkefeld JoernBerkefeld added the enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story" label Apr 18, 2024
@JoernBerkefeld JoernBerkefeld added this to the 6.1.0 milestone Apr 18, 2024
@JoernBerkefeld JoernBerkefeld self-assigned this Apr 18, 2024
JoernBerkefeld added a commit that referenced this issue Apr 19, 2024
JoernBerkefeld added a commit that referenced this issue Apr 19, 2024
JoernBerkefeld added a commit that referenced this issue Apr 19, 2024
@JoernBerkefeld JoernBerkefeld changed the title [FEATURE] add method replaceReference to find&replace contentBlockByX with one of the other options [FEATURE] add method replaceReference to find&replace ampscript contentBlockByX with one of the other options May 3, 2024
@JoernBerkefeld JoernBerkefeld modified the milestones: 6.1.0, 6.2.0 May 14, 2024
@JoernBerkefeld JoernBerkefeld modified the milestones: 7.2.0, 7.0.0 May 21, 2024
JoernBerkefeld added a commit that referenced this issue Jun 2, 2024
JoernBerkefeld added a commit that referenced this issue Jun 2, 2024
JoernBerkefeld added a commit that referenced this issue Jun 2, 2024
JoernBerkefeld added a commit that referenced this issue Jun 2, 2024
JoernBerkefeld added a commit that referenced this issue Jun 2, 2024
JoernBerkefeld added a commit that referenced this issue Jun 2, 2024
JoernBerkefeld added a commit that referenced this issue Jun 2, 2024
JoernBerkefeld added a commit that referenced this issue Jun 2, 2024
JoernBerkefeld added a commit that referenced this issue Jun 2, 2024
JoernBerkefeld added a commit that referenced this issue Jun 2, 2024
JoernBerkefeld added a commit that referenced this issue Jun 5, 2024
…ge preheader to ampscript

file-type: ampscript
JoernBerkefeld added a commit that referenced this issue Jun 6, 2024
JoernBerkefeld added a commit that referenced this issue Jun 6, 2024
JoernBerkefeld added a commit that referenced this issue Jun 6, 2024
JoernBerkefeld added a commit that referenced this issue Jun 6, 2024
…hout keys/names - if typekeycombo was handed in
JoernBerkefeld added a commit that referenced this issue Jun 7, 2024
JoernBerkefeld added a commit that referenced this issue Jun 7, 2024
@github-actions github-actions bot closed this as completed Jun 7, 2024
Copy link

github-actions bot commented Jun 7, 2024

Closed by #1353.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story"
Projects
None yet
1 participant