# Accessing/render merge tag data in notification\['message'\] using gform\_notification \[RESOLVED\]

**URL:** <https://community.gravityforms.com/t/accessing-render-merge-tag-data-in-notification-message-using-gform-notification-resolved/5609>\
**Category:** Get Help\
**Tags:** custom, sendgrid, merge-tags, replace\_variables\
**Created:** [August 3, 2020, 8:20pm UTC](https://community.gravityforms.com/t/accessing-render-merge-tag-data-in-notification-message-using-gform-notification-resolved/5609 "2020-08-03T20:20:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeynon](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jeynon](https://community.gravityforms.com/u/jeynon)\
**Post date:** [August 3, 2020, 8:20pm UTC](https://community.gravityforms.com/t/accessing-render-merge-tag-data-in-notification-message-using-gform-notification-resolved/5609/1 "2020-08-03T20:20:35Z")

</div>

I have a piece of code using gform\_notifications that is being used to move the notification information out of GF and into SendGrid. I suppress the email send and send the email via SendGrid in a unique template I have made. It also has the opt out links attached to it.

The issue is the email sent via SendGrid contains the merge\_tags as text and not their value. See the snippet below. How can I get $notification[‘message’] to render here? What hook does it render?

```
    add_filter( 'gform_notification', 'check_supress', 10, 3 );
    function check_supress( $notification, $form, $entry ) {    
   // all kinds of other stuff happens here prepping for SendGrid/////
   $email1, "My Name" ,
     [
      "body" => $notification['message'],
      "image_1" => $thumb,
      "url" => $url,
      "subject" => $notification['subject']
     ]
    // Send Grid then sends the email using the variables above. Only issue is merge tags in subject and message are not values..
   }
```

---

<div class="post-metadata">

**Author:** ![Jake\_Jackson](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/jake_jackson/32/14685_2.png) [@Jake\_Jackson](https://community.gravityforms.com/u/Jake_Jackson)\
**Post date:** [August 5, 2020, 5:07am UTC](https://community.gravityforms.com/t/accessing-render-merge-tag-data-in-notification-message-using-gform-notification-resolved/5609/2 "2020-08-05T05:07:27Z")

</div>

Hey!

Run `$notification['message']` through the `GFCommon::replace_variables()` method. You would use it like this:

```auto
   add_filter( 'gform_notification', 'check_supress', 10, 3 );
    function check_supress( $notification, $form, $entry ) {    
   // all kinds of other stuff happens here prepping for SendGrid/////
   $email1, "My Name" ,
     [
      "body" => \GFCommon::replace_variables( $notification['message'], $form, $entry )
      "image_1" => $thumb,
      "url" => $url,
      "subject" => \GFCommon::replace_variables( $notification['subject'], $form, $entry ),
     ]
    // Send Grid then sends the email using the variables above. Only issue is merge tags in subject and message are not values..
   }

```

Hope that helps!

---

<div class="post-metadata">

**Author:** ![jeynon](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jeynon](https://community.gravityforms.com/u/jeynon)\
**Post date:** [August 5, 2020, 12:10pm UTC](https://community.gravityforms.com/t/accessing-render-merge-tag-data-in-notification-message-using-gform-notification-resolved/5609/3 "2020-08-05T12:10:27Z")

</div>

Bullseye! Thanks @Jake_Jackson

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [August 5, 2020, 9:13pm UTC](https://community.gravityforms.com/t/accessing-render-merge-tag-data-in-notification-message-using-gform-notification-resolved/5609/4 "2020-08-05T21:13:53Z")

</div>

@Jake_Jackson [GOAT](https://www.allacronyms.com/GOAT/Greatest_Of_All_Time)

 ![70708_web](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/9/9b939f6a7c26a735ef9b0d233869748514909488.jpeg)

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 4, 2022, 5:57pm UTC](https://community.gravityforms.com/t/accessing-render-merge-tag-data-in-notification-message-using-gform-notification-resolved/5609/5 "2022-01-04T17:57:48Z")

</div>


