mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-18 03:52:54 +00:00
fix(g1g1): send promo confirmation to self
This commit is contained in:
parent
34983f1221
commit
9fe28c6d51
2 changed files with 10 additions and 2 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue