# Keyword Support in Course Bulk Emails with edX ACE

**URL:** <https://discuss.openedx.org/t/keyword-support-in-course-bulk-emails-with-edx-ace/8339>\
**Category:** Site Operations Help\
**Created:** [September 21, 2022, 2:35pm UTC](https://discuss.openedx.org/t/keyword-support-in-course-bulk-emails-with-edx-ace/8339 "2022-09-21T14:35:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![emartus](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/emartus/32/5604_2.png) [@emartus](https://discuss.openedx.org/u/emartus)\
**Post date:** [September 21, 2022, 2:35pm UTC](https://discuss.openedx.org/t/keyword-support-in-course-bulk-emails-with-edx-ace/8339/1 "2022-09-21T14:35:13Z")

</div>

We have enabled bulk course emails on our site and read in the documentation that we should be able to use keywords in the messages. [Bulk Email Documenation](https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/manage_live_course/bulk_email.html#use-keywords-in-messages)

From looking through the code, it looks like the keyword replacement only happens when sending bulk emails not using edX ACE. The replacement function can be found in [edx-platform/common/djangoapps/util\_keyword\_substitution.py](https://github.com/openedx/edx-platform/blob/4ecd9fe683c663b621c92a2b31fb358f0679b9fa/common/djangoapps/util/keyword_substitution.py#L35) and gets called during [DjangoEmail rendering process](https://github.com/openedx/edx-platform/blob/4ecd9fe683c663b621c92a2b31fb358f0679b9fa/lms/djangoapps/bulk_email/messages.py#L29).

Is there any way to use keywords and edX ACE and keywords at the same time or is the only solution to not use edX ACE? If that’s the case, how can I customize the email sent with Django Email?

---

<div class="post-metadata">

**Author:** ![Zia\_Fazal](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/zia_fazal/32/2259_2.png) [@Zia\_Fazal](https://discuss.openedx.org/u/Zia_Fazal)\
**Post date:** [September 22, 2022, 9:20am UTC](https://discuss.openedx.org/t/keyword-support-in-course-bulk-emails-with-edx-ace/8339/2 "2022-09-22T09:20:48Z")

</div>

Hi @emartus ,

Yes keyword substitution is not supported in case of sending bulk course email via edX ACE I guess that is because in case of edX ACE file based template is used instead of pulling from DB. You can use open edX [theming](https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/changing_appearance/theming/) capabilities to theme/customize your edX ACE templates. You can override default bulk course email [template](https://github.com/openedx/edx-platform/blob/master/lms/templates/bulk_email/edx_ace/bulkemail/email/body.html) and use any of these variables in your custom template.

```auto
course_title
course_language
course_url
course_id
course_image_url
course_end_date
logo_url
platform_name
user_id
email
name

```

---

<div class="post-metadata">

**Author:** ![emartus](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/emartus/32/5604_2.png) [@emartus](https://discuss.openedx.org/u/emartus)\
**Post date:** [September 22, 2022, 1:08pm UTC](https://discuss.openedx.org/t/keyword-support-in-course-bulk-emails-with-edx-ace/8339/3 "2022-09-22T13:08:53Z")

</div>

@Zia_Fazal thank you for your reply! Can these be used within the message body or can they only be used within the template? Ideally we would like to enable our instructors and content providers to use these freely within their messages.

---

<div class="post-metadata">

**Author:** ![Zia\_Fazal](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/zia_fazal/32/2259_2.png) [@Zia\_Fazal](https://discuss.openedx.org/u/Zia_Fazal)\
**Post date:** [September 22, 2022, 2:04pm UTC](https://discuss.openedx.org/t/keyword-support-in-course-bulk-emails-with-edx-ace/8339/4 "2022-09-22T14:04:48Z")

</div>

@emartus I don’t think these variables can be used in message body.

---

<div class="post-metadata">

**Author:** ![emartus](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/emartus/32/5604_2.png) [@emartus](https://discuss.openedx.org/u/emartus)\
**Post date:** [September 22, 2022, 2:37pm UTC](https://discuss.openedx.org/t/keyword-support-in-course-bulk-emails-with-edx-ace/8339/5 "2022-09-22T14:37:21Z")

</div>

@Zia_Fazal I was just able to test and confirm these variables cannot be used in the message body. Theming the emails seems straightforward enough, but I will have to see if it will suit our needs in the long term.  
I’ve figured out how to switch back to using the basic Django email by setting `BULK_EMAIL_SEND_USING_EDX_ACE = False` in `development.py`. This allows for using the keyword variables mentioned in the documentation.

```auto
%%USER_ID%%
%%USER_FULLNAME%%
%%COURSE_DISPLAY_NAME%%
%%COURSE_END_DATE%%

```

From what I’ve been able to tell thus far, the downside is that template can only be managed in Django Admin under Bulk\_Email \> Course email templates ([https://www.example.com/admin/bulk\_email/courseemailtemplate/](https://www.example.com/admin/bulk_email/courseemailtemplate/)). Here you can either edit/create a template with the name field set to empty which will be used as the default, or create a new named template and add `"course_email_template_name":"my_template"` to your site configuration.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/e/e0015f89e879bc75925b71fd11133ab15fe98297.png) [@system](https://discuss.openedx.org/u/system)\
**Post date:** [December 21, 2022, 2:37pm UTC](https://discuss.openedx.org/t/keyword-support-in-course-bulk-emails-with-edx-ace/8339/6 "2022-12-21T14:37:33Z")

</div>

Closed on December 21, 2022, 2:37pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
