Skip to content

Commit

Permalink
Ensure list name is in lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinsonZ committed Sep 4, 2023
1 parent 6b835eb commit 1d9b504
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/functions/createMailingList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const createMailingList = async (data: any) => {

const [emailText, transporter] = await Promise.all([
generateEmail('newMailingList.html', {
listName: data.listName,
listName: data.listName.toLowerCase(),
user: data.creator,
}),
mailTransporter,
Expand Down
4 changes: 2 additions & 2 deletions src/integration/mailman.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const getMailingList = async (name: string): Promise<any> => {

export const addMailingList = async (name: string, ownerEmail: string) => {
logger.debug(`Creating list ${name} owned by ${ownerEmail}`);
const createResponse = await api.post('/lists', { fqdn_listname: `${name}@sccs.swarthmore.edu` });
const createResponse = await api.post('/lists', { fqdn_listname: `${name.toLowerCase()}@sccs.swarthmore.edu` });

if (createResponse.status != 201) {
const errDesc =
Expand All @@ -54,7 +54,7 @@ export const addMailingList = async (name: string, ownerEmail: string) => {
logger.debug(`Adding ${ownerEmail} as owner of mailing list ${name}`);

const addOwnerResponse = await api.post('/members', {
list_id: `${name}.sccs.swarthmore.edu`,
list_id: `${name.toLowerCase()}.sccs.swarthmore.edu`,
subscriber: ownerEmail,
role: 'owner',
});
Expand Down

0 comments on commit 1d9b504

Please sign in to comment.