Skip to content

Commit

Permalink
Content updates (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
xdmorgan authored Mar 7, 2020
1 parent 976a51e commit 6376bc8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 20 deletions.
12 changes: 8 additions & 4 deletions src/components/about-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ export function AboutSection() {
>
<h2 className="h3 mb-2x">Skills &amp; Expertise</h2>
<p className="small c-mystic">
Throughout my career, I&rsquo;ve worked with companies like:
Cartoon Network, EA Sports, Facebook, Huge, LinkedIn, NASA,
Oculus, and Wayfair to craft digital products for web, mobile, and
emerging platforms.
Over my career, I&rsquo;ve worked with Cartoon Network, Cvent, EA
Sports, Facebook, Huge, LinkedIn, NASA, Oculus, and Wayfair to
craft digital products for mobile, web, and emerging platforms.
</p>
<p className="small c-mystic">
Whilst building dozens of products, I&rsquo;ve been introduced to
a diverse group of technologies and methodologies with a
specialization in UI architecture and design systems.
</p>
</div>
<div className={cx(styles.grid__skills, styles.skills)}>
Expand Down
6 changes: 3 additions & 3 deletions src/components/contact-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export function ContactSection() {
<h2 className="h1 my-0">Want to get in touch?</h2>
<p
className="mt-2x mb-4x md:mt-3x para"
style={{ maxWidth: 660, marginLeft: 'auto', marginRight: 'auto' }}
style={{ maxWidth: 500, marginLeft: 'auto', marginRight: 'auto' }}
>
If you’re looking to collaborate on your next project or just want to
say hello, feel free to drop me a line anytime. 🤙
If you’re looking to collaborate or just want to say hello, feel free
to drop me a line anytime. 🤙
</p>
<Button href="mailto:[email protected]">Send me a message</Button>
</div>
Expand Down
11 changes: 6 additions & 5 deletions src/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ export function Footer() {
'md:align-r'
)}
>
<NavLink to="/">About</NavLink>
<NavLink to="/">Blog</NavLink>
<NavLink to="/">Contact</NavLink>
<NavLink to="/#about">About</NavLink>
<NavLink to="/#projects">Projects</NavLink>
<NavLink to="/#contact">Contact</NavLink>
<NavLink to={GITHUB}>GitHub</NavLink>
<NavLink to={TWITTER}>Twitter</NavLink>
<NavLink to={LINKEDIN}>Linked In</NavLink>
<NavLink to="/">RSS</NavLink>
<NavLink to="/">Uses</NavLink>
<NavLink to="/#articles">Blog</NavLink>
<NavLink to="/styleguide">Styleguide</NavLink>
{/* <NavLink to="/">RSS</NavLink>
<NavLink to="/">Uses</NavLink> */}
</ul>
<p
className={cx(
Expand Down
2 changes: 1 addition & 1 deletion src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function Header({
)}
>
<NavLink to="/#about">About</NavLink>
<NavLink to="/#projects">Work</NavLink>
<NavLink to="/#projects">Projects</NavLink>
<NavLink to="/#contact">Contact</NavLink>
</ul>
</nav>
Expand Down
16 changes: 10 additions & 6 deletions src/content/posts/mailchimp-api-interests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ date: 2019-08-22
status: published
category: Tutorials
tags: Mailchimp, PHP, Tutorial
lede: 'A client recently asked me to update their Mailchimp integration to add support for sub-group targeting using interest groups. Finding the process more involved than I expected, I wanted to share my experience locating the relevant IDs in the admin interface and examples including them in an API request.'
lede: 'How to find then use Mailchimp interest group IDs to target groups of subscribers based on common chararacteristics, examples provided in PHP and JavaScript (Node)'
theme:
header: '#1f2230'
image:
Expand All @@ -15,6 +15,10 @@ image:
link: 'https://unsplash.com/photos/fb7yNPbT0l8'
---

A client recently asked me to update their PHP Mailchimp integration to support targeting subscribers based on interests. To my surprise, locating the interest ID was more involved than updating the existing API requests.

Before we get started, we'll need an API key which we'll use to access Mailchimp's API playground and authenticate API calls. If you already have an API key, skip ahead to the [Finding the Interest ID](#finding-the-interest-id) section below.

## Creating an API Key

In order to create new users using we'll first need to create an API key with access to our account. Sign into Mailchimp then go to the [Account Settings > Extras > API Keys](https://us4.admin.mailchimp.com/account/api/) page then **Create a Key**.
Expand All @@ -38,9 +42,9 @@ First, select `Lists` then use the Subresources dropdown to select `interest-cat

## Usage in API Requests

### PHP Requests
### PHP Example

Download this [Mailchimp API wrapper](https://github.com/drewm/mailchimp-api/blob/master/src/Mailchimp.php) class, and save it next to our script so it can be found by the `include(./Mailchimp.php)` call on line 7 below.
Download this [Mailchimp API wrapper](https://github.com/drewm/mailchimp-api/blob/master/src/MailChimp.php) class, and save it next to our script so it can be found by the `include(./Mailchimp.php)` call on line 7 below.

Next, we need the API Token created in the first section, as well as the List ID and Interest ID from the second. Replace `API_TOKEN`, `LIST_ID`, and `INTEREST_ID` in the constant definitions on lines 2–4.

Expand Down Expand Up @@ -75,9 +79,9 @@ if ($email != '') {
echo json_encode($result);
```

### Node.js Requests
### Node.js Example

Since writing the original version of this post, I was asked to implement similar functionality for a static site deployed to Netlify. Using the same method for locating the necessary API information described above, [see here](https://github.com/xdmorgan/netlify-functions/tree/master/functions/mailchimp-subscribe) for a drop-in Node-based Lambda function solution.
Since writing the original version of this post, I was asked to add the same functionality to a Gatsby site hosted on Netlify. After obtaining necessary API information described above, see below for a JavaScript example or [see here](https://github.com/xdmorgan/netlify-functions/tree/master/functions/mailchimp-subscribe) for a ready-to-use Node serverless function.

```js
// Node SDK
Expand Down Expand Up @@ -141,5 +145,5 @@ function format_interests(arr = []) {

## References & Resources

- [Mailchimp API PHP Class](https://github.com/drewm/mailchimp-api/blob/master/src/Mailchimp.php)
- [Mailchimp API PHP Class](https://github.com/drewm/mailchimp-api/blob/master/src/MailChimp.php)
- [StackOverflow: Finding Mailchimp List IDs](https://stackoverflow.com/questions/37311116/can-you-get-a-mailchimp-interest-group-id-without-using-the-api)
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function Page({ data }: any) {
imageSrc={featuredProjectImage.childImageSharp}
imageAlt="Designer fund employees"
title="Design for Business Impact"
description="A triumvirate of Gatsby, Contentful, and Netlify power this Designer Fund microsite. The site was featured on Awwwards and integrates with the Mailchimp API using serverless Netlify Functions."
description="Gatsby, Contentful, and Netlify power this Designer Fund microsite featured on Awwwards and Communication Arts. Authentication integrates with Mailchimp using custom serverless Netlify Functions."
url="https://designerfund.com/business-impact"
/>
<ProjectsAndArticlesSection
Expand Down

0 comments on commit 6376bc8

Please sign in to comment.