fix(g1g1): send promo confirmation to self

This commit is contained in:
Sabe Jones 2019-12-17 14:16:56 -06:00
parent 34983f1221
commit 9fe28c6d51
2 changed files with 10 additions and 2 deletions

View file

@ -253,7 +253,7 @@ describe('payments/index', () => {
});
});
context('Winter 2018-19 Gift-1-Get-1 Promotion', async () => {
context('Winter 2019-20 Gift-1-Get-1 Promotion', async () => {
it('creates a gift subscription for purchaser and recipient if none exist', async () => {
await api.createSubscription(data);

View file

@ -187,7 +187,15 @@ async function createSubscription (data) {
// generate the message in both languages, so both users can understand it
const languages = [data.user.preferences.language, data.gift.member.preferences.language];
if (!data.promo) {
if (data.promo) {
let senderMsg = shared.i18n.t(`giftedSubscription${data.promo}Promo`, {
username: data.gift.member.profile.name,
monthCount: shared.content.subscriptionBlocks[data.gift.subscription.key].months,
}, languages[0]);
senderMsg = `\`${senderMsg}\``;
data.user.sendMessage(data.gift.member, { senderMsg });
} else {
let senderMsg = shared.i18n.t('giftedSubscriptionFull', {
username: data.gift.member.profile.name,
sender: byUserName,