Skip to content

Commit

Permalink
chore!: removed Mailer.sendMail and Mailer:unsubscribe methods
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
  • Loading branch information
abhinavkrin committed Sep 25, 2024
1 parent cb512e1 commit 03e6515
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 74 deletions.
7 changes: 5 additions & 2 deletions apps/meteor/app/api/server/v1/mailer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { isMailerProps, isMailerUnsubscribeProps } from '@rocket.chat/rest-typings';

import { sendMail } from '../../../mail-messages/server/functions/sendMail';
import { Mailer } from '../../../mail-messages/server/lib/Mailer';
import { API } from '../api';

API.v1.addRoute(
Expand All @@ -13,7 +15,7 @@ API.v1.addRoute(
async post() {
const { from, subject, body, dryrun, query } = this.bodyParams;

const result = await Meteor.callAsync('Mailer.sendMail', from, subject, body, Boolean(dryrun), query);
const result = await sendMail({ from, subject, body, dryrun: Boolean(dryrun), query });

return API.v1.success(result);
},
Expand All @@ -25,12 +27,13 @@ API.v1.addRoute(
{
authRequired: true,
validateParams: isMailerUnsubscribeProps,
rateLimiterOptions: { intervalTimeInMS: 60000, numRequestsAllowed: 1 },
},
{
async post() {
const { _id, createdAt } = this.bodyParams;

await Meteor.callAsync('Mailer:unsubscribe', _id, createdAt);
await Mailer.unsubscribe(_id, createdAt);

return API.v1.success();
},
Expand Down
2 changes: 0 additions & 2 deletions apps/meteor/app/mail-messages/server/index.ts

This file was deleted.

36 changes: 0 additions & 36 deletions apps/meteor/app/mail-messages/server/methods/sendMail.ts

This file was deleted.

33 changes: 0 additions & 33 deletions apps/meteor/app/mail-messages/server/methods/unsubscribe.ts

This file was deleted.

1 change: 0 additions & 1 deletion apps/meteor/server/importPackages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ import '../app/e2e/server';
import '../app/version-check/server';
import '../app/search/server';
import '../app/discussion/server';
import '../app/mail-messages/server';
import '../app/user-status/server';
import '../app/metrics/server';
import '../app/notifications/server';
Expand Down

0 comments on commit 03e6515

Please sign in to comment.