Skip to content

Commit

Permalink
Merge pull request #42 from jwade1327/ame-setup
Browse files Browse the repository at this point in the history
Setup AME newsletters
  • Loading branch information
Shinsina authored Nov 7, 2023
2 parents c754639 + d8bcc1d commit d5fb2b8
Show file tree
Hide file tree
Showing 9 changed files with 322 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tenants/all/config/brands.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ module.exports = {
socialMedia: {
imagePath: '/files/base/smg/all/image/static/newsletter',
links: [
{ provider: 'facebook', href: 'https://www.facebook.com/auntminnie.radiology', target: '_blank' },
{ provider: 'twitter', href: 'https://twitter.com/AuntMinnie', target: '_blank' },
{ provider: 'facebook', href: 'https://www.facebook.com/auntminnieeurope', target: '_blank' },
{ provider: 'twitter', href: 'https://twitter.com/auntminnieeurope', target: '_blank' },
{ provider: 'linkedin', href: 'https://www.linkedin.com/company/auntminnieeurope.com/', target: '_blank' },
],
},
},
Expand Down
45 changes: 45 additions & 0 deletions tenants/all/config/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,51 @@ const config = {
},
preferenceCenter: 'https://www.auntminnieeurope.com/user/subscribe',
},
'ame-breaking-news': {
...brands.ame,
name: 'AuntMinnieEurope-Breaking News',
logo: {
src: '/files/base/smg/all/image/static/ame/AuntMinnieEurope-BreakingNews.png',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnieeurope.com/user/subscribe',
},
'ame-case-of-the-week': {
...brands.ame,
name: 'AuntMinnieEurope-Case of the Week',
logo: {
src: '/files/base/smg/all/image/static/ame/AuntMinnieEurope-weekly.png',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnieeurope.com/user/subscribe',
},
'ame-community-insider': {
...brands.ame,
name: 'AuntMinnieEurope-Community Insider',
logo: {
src: '/files/base/smg/all/image/static/ame/AuntMinnieEurope-Insider.png',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnieeurope.com/user/subscribe',
},
'ame-lfte': {
...brands.ame,
name: 'AuntMinnieEurope-LFTE',
logo: {
src: '/files/base/smg/all/image/static/ame/AuntMinnieEurope-LFTE.png',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnieeurope.com/user/subscribe',
},
'ame-radcast': {
...brands.ame,
name: 'AuntMinnieEurope-Radcast',
logo: {
src: '/files/base/smg/all/image/static/ame/AuntMinnieEurope-Radcast.png',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnieeurope.com/user/subscribe',
},
};

module.exports = config;
40 changes: 40 additions & 0 deletions tenants/all/config/email-x.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,46 @@ config
width: 300,
height: 250,
},
])
.setAdUnits('ame-lfte', [
{
name: 'ad-slot-1',
id: '65493d957ed285419964a0e7',
width: 300,
height: 250,
},
])
.setAdUnits('ame-community-insider', [
{
name: 'ad-slot-1',
id: '65493dc45df77b42a6a1f8b9',
width: 300,
height: 250,
},
])
.setAdUnits('ame-breaking-news', [
{
name: 'ad-slot-1',
id: '65493de57ed2853fea64a14b',
width: 300,
height: 250,
},
])
.setAdUnits('ame-case-of-the-week', [
{
name: 'ad-slot-1',
id: '654945655df77b23f9a1f91d',
width: 300,
height: 250,
},
])
.setAdUnits('ame-radcast', [
{
name: 'ad-slot-1',
id: '6549457f7ed285655364a1b8',
width: 300,
height: 250,
},
]);

module.exports = config;
17 changes: 17 additions & 0 deletions tenants/all/config/native-x.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,22 @@ module.exports = {
'ame-senl': {
'slot-1': '652352cd1449000001cb3ea4',
},
'ame-lfte': {
'slot-1': '654946b991f3fc0001ea8fb2',
'case-sponsor': '654946d87493750001592a30',
},
'ame-community-insider': {
community: '654947007493750001592a69',
'slot-1': '6549470d7493750001592a85',
},
'ame-breaking-news': {
'slot-1': '654947227493750001592abb',
},
'ame-case-of-the-week': {
'case-sponsor': '654947497493750001592ad9',
},
'ame-radcast': {
'slot-1': '6549475a91f3fc0001ea907c',
},
},
};
1 change: 1 addition & 0 deletions tenants/all/templates/ame-breaking-news.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-breaking-news-layout data=data />
63 changes: 63 additions & 0 deletions tenants/all/templates/ame-case-of-the-week.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { get } from "@parameter1/base-cms-object-path";
import { parseBooleanHeader } from "@parameter1/base-cms-utils";
import queryFragment from "@science-medicine-group/package-common/graphql/fragments/content-list";
import defaultValue from "@parameter1/base-cms-marko-core/utils/default-value";

$ const { website, config, req } = out.global;
$ const { newsletter, date } = data;

$ const emailX = config.get("emailX");
$ const nativeX = config.getAsObject("nativeX");
$ const { id, alias, name, pageNode } = input;

$ const newsletterConfig = config.get(newsletter.alias);
$ const ctaLinkStyle = defaultValue(newsletterConfig.ctaLinkStyle, undefined);

$ const resolvedToNodesConverter = ({ resolved }) => (resolved.map((node) => ({
id: node.ID,
type: 'Case',
shortName: node.name,
teaser: node.description,
siteContext: { url: `https://my.auntminnie.com/cases/${node.url}` },
primaryImage: { src: node.imagepath }
})));

<marko-newsletter-root
title=newsletter.name
description=newsletter.description
date=date
>
<@head>
<common-head-block />
</@head>
<@body style="padding:0; margin:0;font-family: 'Roboto', Arial, sans-serif; -webkit-text-size-adjust:100%;">
<common-body-wrapper-block newsletter=newsletter date=date>
<@body>

<common-ad-wrapper-block
date=date
newsletter=newsletter
promotion-component="case-native-block"
placement-id=get(nativeX, `placements.${newsletter.alias}.case-sponsor`)
/>

<common-external-api-block
api-url="https://my.auntminnie.com/wp-json/mo/v1/getCase/3"
resolved-to-nodes-converter=resolvedToNodesConverter
name="Case of the Week"
description="Check out our Case of the Week!"
button={ link: "https://my.auntminnie.com/cases", text: "View All Cases" }
cta-link-style=ctaLinkStyle
/>

<common-ad-wrapper-block
newsletter=newsletter
promotion-component="advertisement-block"
ad-unit=emailX.getAdUnit({ name: 'ad-slot-1', alias: newsletter.alias })
date=date
/>

</@body>
</common-body-wrapper-block>
</@body>
</marko-newsletter-root>
1 change: 1 addition & 0 deletions tenants/all/templates/ame-community-insider.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-insider-layout data=data display-limit=16/>
151 changes: 151 additions & 0 deletions tenants/all/templates/ame-lfte.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
import { get } from "@parameter1/base-cms-object-path";
import { parseBooleanHeader } from "@parameter1/base-cms-utils";
import queryFragment from "@science-medicine-group/package-common/graphql/fragments/content-list";
import defaultValue from "@parameter1/base-cms-marko-core/utils/default-value";

$ const { website, config, req } = out.global;
$ const { newsletter, date } = data;

$ const emailX = config.get("emailX");
$ const nativeX = config.getAsObject("nativeX");
$ const { id, alias, name, pageNode } = input;

$ const newsletterConfig = config.get(newsletter.alias);
$ const caseBlock = get(newsletterConfig, "caseBlock");
$ const ctaLinkStyle = defaultValue(newsletterConfig.ctaLinkStyle, undefined);

$ const resolvedToNodesConverter = ({ resolved }) => (resolved.map((node) => ({
id: node.ID,
type: 'Case',
shortName: node.name,
teaser: node.description,
siteContext: { url: `https://my.auntminnie.com/cases/${node.url}` },
primaryImage: { src: node.imagepath }
})));

<marko-newsletter-root
title=newsletter.name
description=newsletter.description
date=date
>
<@head>
<common-head-block />
</@head>
<@body style="padding:0; margin:0;font-family: 'Roboto', Arial, sans-serif; -webkit-text-size-adjust:100%;">
<common-body-wrapper-block newsletter=newsletter date=date>
<@body>

<!-- Content list block -->
<common-content-list-block
date=date
section-name="Editor's Note"
newsletter=newsletter
with-image=true
image-position="right"
with-header=true
continue-reading=true
limit=1
/>

<common-content-list-block
date=date
section-name="Main"
newsletter=newsletter
with-image=true
image-position="right"
with-section=true
limit=1
skip=0
/>

<!-- Content list block -->
<common-content-list-block
date=date
section-name="Main"
newsletter=newsletter
with-image=false
with-section=true
limit=1
skip=1
/>

<common-content-list-block
date=date
section-name="Main"
newsletter=newsletter
with-image=true
image-position="right"
with-section=true
limit=1
skip=2
/>

<!-- Ad Slot 1 -->
<common-ad-wrapper-block
newsletter=newsletter
promotion-component="advertisement-block"
ad-unit=emailX.getAdUnit({ name: 'ad-slot-1', alias: newsletter.alias })
placement-id=get(nativeX, `placements.${newsletter.alias}.slot-1`)
date=date
/>

<!-- Content list block -->
<common-content-list-block
date=date
section-name="Main"
newsletter=newsletter
with-image=false
with-section=true
skip=3
limit=42
/>

<if(caseBlock === true)>
<tr>
<td align="center" valign="top">
<table role="presentation" width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background: #eff1f3;">
<tr>
<td align="center" valign="middle" height="38">
<p style="font-size:15px;color: #000000;text-decoration: none;display: block;font-weight:700;font-family:'Roboto', Arial, sans-serif;text-transform: uppercase;padding: 0 24px;">
Case of the Week
</p>
</td>
</tr>
</table>
</td>
</tr>
<common-table-spacer-element height="24" />

<common-ad-wrapper-block
date=date
newsletter=newsletter
promotion-component="case-native-block"
placement-id=get(nativeX, `placements.${newsletter.alias}.case-sponsor`)
/>

<common-external-api-block
api-url="https://my.auntminnie.com/wp-json/mo/v1/getCase/3"
resolved-to-nodes-converter=resolvedToNodesConverter
name="Case of the Week"
description="Check out our Case of the Week!"
button={ link: "https://my.auntminnie.com/cases", text: "View All Cases" }
cta-link-style=ctaLinkStyle
/>
</if>

<!-- Content list block -->
<common-content-list-block
date=date
section-name="In Case You Missed It"
newsletter=newsletter
with-image=true
image-position="right"
with-header=true
continue-reading=false
limit=5
/>

</@body>
</common-body-wrapper-block>
</@body>
</marko-newsletter-root>
1 change: 1 addition & 0 deletions tenants/all/templates/ame-radcast.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-radcast-layout data=data />

0 comments on commit d5fb2b8

Please sign in to comment.