Jeff VIP
Total posts: 745
04 Mar 2015 03:23

Hi,

I would like to extract more data from the emerald_subscriptions table to put into the subscription success alert email.

Currently only the following placeholders are available (com_emerald/helpers/emerald.php):

  • [USER] name of the user.
  • [DAY] how many days before expire. Only in expiration alert.
  • [PLAN] name of the plan.
  • [ORDER_ID] transaction ID from payment gateway
  • [LINK] URL to purchase history page
  • [AMOUNT] amount purchased.
  • [GROUPNAME] Name of the plan`s group.

I would like to add:

  • [NOTE] plan details like record name, start/end date.

Where [NOTE] is derived from a column in the emerald_subscriptions table.

My users can prolong an article by purchasing extension time. Unfortunately I am not able to include vital information like the name of the article and the start and end date of the extension time in the success mail.

Sergey, if you could just add [NOTE] as a placeholder I would be very happy :-)

Best regards, Jeff

Last Modified: 08 Apr 2015


Sergey
Total posts: 13,748
04 Mar 2015 10:42

Added [NOTE], [START], [END].


Jeff VIP
Total posts: 745
04 Mar 2015 10:47

Sergey Added [NOTE], [START], [END].

+1

Happy!


Jeff VIP
Total posts: 745
09 Mar 2015 07:16

Hi Sergey,

I am afraid [NOTE] [START] and [END] are not working with the latest version of Emerald (v9.322).

[NOTE] displays nothing in the email and [START] and [END] show both November 30, -0001

BTW. These extra fields are not mentioned in the plan settings. Is that on purpose?


Sergey
Total posts: 13,748
09 Mar 2015 09:02

Jeff [NOTE] displays nothing in the email

Is there anything in the note column in DB?

Jeff [START] and [END] show both November 30, -0001

Ok. It turned out that on success event alert was sent earlier than period was set. Fixed now.


Jeff VIP
Total posts: 745
09 Mar 2015 10:13

Sergey Is there anything in the note column in DB?

Yes

Sergey Ok. It turned out that on success event alert was sent earlier than period was set. Fixed now.

Aah, ok. So the note issue is solved too?


Sergey
Total posts: 13,748
10 Mar 2015 05:35

Should be.


Jeff VIP
Total posts: 745
13 Mar 2015 05:10

It seems that after the last update [START] and [END] are included in the email and now show the correct dates. Great!

[NOTE] however, is still empty. Has this something to do with my custom prolong plugin?


Jeff VIP
Total posts: 745
13 Mar 2015 05:27

Is it possible to include the gateway(payment method)?

I would include something like this in the email:

Payed with [GATEWAY]

Which would read as:

Paid with Paypal or Paid with coupon.


Sergey
Total posts: 13,748
17 Mar 2015 06:23

Added.


Jeff VIP
Total posts: 745
17 Mar 2015 23:12

Sergey Added.

+1

Any explanation why [NOTE] is empty in the email?


Sergey
Total posts: 13,748
20 Mar 2015 04:32

Jeff Any explanation why [NOTE] is empty in the email?

Is in not empty in subscription table? May be it is inserted there after email is sent. I do nto remember how your prolong system work.


Jeff VIP
Total posts: 745
20 Mar 2015 05:11

Sergey Is in not empty in subscription table?

No

Sergey May be it is inserted there after email is sent.

Maybe you are right.

Sergey I do nto remember how your prolong system work.

I just posted a private message with the code


Sergey
Total posts: 13,748
23 Mar 2015 03:37

I see. Yes, the article prolong happen in action. Action is when user update page and it happens after subscription confirmed by gateway.


Jeff VIP
Total posts: 745
23 Mar 2015 04:03

Sergey I see. Yes, the article prolong happen in action. Action is when user update page and it happens after subscription confirmed by gateway.

Solution?


Sergey
Total posts: 13,748
30 Mar 2015 08:52

I do nto know. I cannot change chain of events.


Jeff VIP
Total posts: 745
31 Mar 2015 01:24

Sergey I do nto know. I cannot change chain of events.

Huh? This really makes no sense to me. The (custom) prolong action is an extension for the Emerald subscription system, right? So why creating something that doesn't comply with Emeralds chain of actions?

So all subscription data is written in the database and can therefore be send immediately after purchase except for the NOTE information? I'm sorry Sergey, this still doesn't make any sense to me.

Not very happy :-(


Sergey
Total posts: 13,748
08 Apr 2015 08:47

The problem is email alert is sent during subscription activation. That is done when payment gateway send a request to your site and Emerald gets it and process.

Note is added on Emarald actions because your prolong is an action of the Emerald. And actiona is triggered when user acces the page. So in most cases email is sent even before prolong action adds note to subscriptions.

Powered by Cobalt