# Creating an endpoint to send bulk emails to scholarx users

**URL:** <https://sef.discourse.group/t/creating-an-endpoint-to-send-bulk-emails-to-scholarx-users/402>\
**Category:** ScholarX\
**Created:** [April 23, 2022, 6:15am UTC](https://sef.discourse.group/t/creating-an-endpoint-to-send-bulk-emails-to-scholarx-users/402 "2022-04-23T06:15:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![piumal1999](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/piumal1999/32/274_2.png) [@piumal1999](https://sef.discourse.group/u/piumal1999)\
**Post date:** [April 23, 2022, 6:15am UTC](https://sef.discourse.group/t/creating-an-endpoint-to-send-bulk-emails-to-scholarx-users/402/1 "2022-04-23T06:15:58Z")

</div>

I created a draft pull request for the emailing feature we discussed on the last standup meeting. ([Engineering Team Weekly Stand Ups 2022 - #3 by Gravewalker](https://sef.discourse.group/t/engineering-team-weekly-stand-ups-2022/397/3))

Endpoint:  
POST /admin/program/{id}/email

Request Body:

```auto
 {
   subject: String,
   message: String,
   mailGroup: Enum("ALL", "ALL_MENTORS", "ALL_MENTEES", "SELECTED_MENTORS", "REJECTED_MENTORS", "SELECTED_MENTEES", "REJECTED_MENTEES"),
       additionalEmails: [array of string] (to send the emails in them)
   },
 }

```

Usage of the endpoint: Sending emails to the selected group and additional email addresses with the given message and subject

Draft PR link: [https://github.com/sef-global/scholarx/pull/320](https://github.com/sef-global/scholarx/pull/320)

cc: [@EngTeam](https://sef.discourse.group/groups/engteam)
