Skip to content

Commit

Permalink
feat: use new support email
Browse files Browse the repository at this point in the history
Looks more professional.
  • Loading branch information
aalemayhu authored Jun 21, 2024
1 parent 2590f32 commit 788308b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CreatedDeck, createResponse } from './createResponse';
import { isPaying } from '../../lib/isPaying';

const getPayingErrorMessage = () => {
return "There was an unknown error with your upload. Please try again. If the problem persists, please contact the developer <a href='mailto:[email protected]'>[email protected]</a>.";
return "There was an unknown error with your upload. Please try again. If the problem persists, please contact <a href='mailto:[email protected]'>[email protected]</a>.";
};

class SimpleUploadController {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ export const CREATE_DECK_SCRIPT_PATH = path.join(
CREATE_DECK_DIR,
'create_deck.py'
);

export const SUPPORT_EMAIL_ADDRESS = '[email protected]';
4 changes: 3 additions & 1 deletion src/lib/misc/getLimitMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { renderToStaticMarkup } from 'react-dom/server';
import { SUPPORT_EMAIL_ADDRESS } from '../constants';

export const getLimitMessage = () =>
renderToStaticMarkup(
Expand Down Expand Up @@ -29,7 +30,8 @@ export const getLimitMessage = () =>
If you already have an account, please{' '}
<a href="/login?redirect=/upload">login</a> and try again. If you are
still experiencing issues, please contact{' '}
<a href="mailto:[email protected]">[email protected]</a>.
<a href={`mailto:${SUPPORT_EMAIL_ADDRESS}`}>${SUPPORT_EMAIL_ADDRESS}</a>
.
</p>
</div>
);
2 changes: 1 addition & 1 deletion src/lib/misc/isLimitError.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isLimitError } from './isLimitError';

const MOCK_MSG = "<div class=\"content\"><h3 class=\"title is-3\">Your request has hit the limit</h3><ul><li>Split your request into multiple smaller ones (i.e.) make your upload size smaller.</li><li><div class=\"is-flex is-align-items-center\"><a class=\"button is-success is-medium mr-2\" href=\"https://buy.stripe.com/eVadTGcCI6Ny73qfZ0\">Subscribe</a> for only 2 EUR per month to remove all the limits.</div></li><li>Or <a href=\"https://alemayhu.com/patreon\">Become a patron</a> to support me.</li></ul><p>If you already have an account, please <a href=\"/login?redirect=/upload\">login</a> and try again. If you are still experiencing issues, please contact <a href=\"mailto:[email protected]\">[email protected]</a>.</p></div>";
const MOCK_MSG = "<div class=\"content\"><h3 class=\"title is-3\">Your request has hit the limit</h3><ul><li>Split your request into multiple smaller ones (i.e.) make your upload size smaller.</li><li><div class=\"is-flex is-align-items-center\"><a class=\"button is-success is-medium mr-2\" href=\"https://buy.stripe.com/eVadTGcCI6Ny73qfZ0\">Subscribe</a> for only 2 EUR per month to remove all the limits.</div></li><li>Or <a href=\"https://alemayhu.com/patreon\">Become a patron</a> to support me.</li></ul><p>If you already have an account, please <a href=\"/login?redirect=/upload\">login</a> and try again. If you are still experiencing issues, please contact <a href=\"mailto:[email protected]\">[email protected]</a>.</p></div>";

describe('isLimitError', () => {
it('returns true ', () => {
Expand Down
8 changes: 4 additions & 4 deletions src/services/EmailService/EmailService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class EmailService implements IEmailService {
to: email,
from: this.defaultSender,
subject: 'Reset your 2anki.net password',
text: `I received your password change request, you can change it here ${link}`,
text: `We received your password change request, you can change it here ${link}`,
html: markup,
replyTo: '[email protected]',
replyTo: '[email protected]',
};

sgMail.send(msg);
Expand All @@ -52,7 +52,7 @@ class EmailService implements IEmailService {
subject: `2anki.net - Your «${filename}» deck is ready`,
text: 'Attached is your deck',
html: markup,
replyTo: '[email protected]',
replyTo: '[email protected]',
attachments: [
{
content: contents.toString('base64'),
Expand All @@ -74,7 +74,7 @@ class EmailService implements IEmailService {
subject: `2anki.net - Your «${filename}» deck is ready`,
text: `Download your deck here: ${link}`,
html: markup,
replyTo: '[email protected]',
replyTo: '[email protected]',
};

await sgMail.send(msg);
Expand Down
4 changes: 2 additions & 2 deletions src/services/EmailService/templates/convert-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ <h1 class="title">Your converted deck is ready!</h1>
<p><strong>Alexander Alemayhu</strong> Developer of 2anki.net</p>
<hr />
<p class="has-text-grey-light">
If you did not request this deck conversion, please contact me via
If you did not request this deck conversion, please contact us via
email
<a href="mailto:[email protected]">[email protected]</a>.
<a href="mailto:[email protected]">[email protected]</a>.
</p>
</div>
</section>
Expand Down
3 changes: 1 addition & 2 deletions src/services/EmailService/templates/convert.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ <h1 class="title">Your converted deck is ready!</h1>
<hr />
<p class="has-text-grey-light">
If you did not request this deck conversion, please contact
the maintainer of 2anki.net via email <a href="mailto:[email protected]">[email protected]</a>.
</p>
us via email <a href="mailto:[email protected]">[email protected]</a>.
</p>
</div>
</section>
Expand Down

0 comments on commit 788308b

Please sign in to comment.