It is useful if Ubercart Affiliate v2 may send notification emails to all the affiliates who earn a commission. We may add the option in the affiliate settings or in every affiliate account profile.
The send action may be instant after the commission added or add an send mail action to the crontab job and send the email when the cron job launch.

thank you.

CommentFileSizeAuthor
#5 uc_affiliate2-603190.patch2.3 KBunivate

Comments

univate’s picture

All we need is tokens exposing the affiliate information for an order and this could be done via conditional action.

bojanz’s picture

I agree with the possible solution presented by "univate"

wqmeng’s picture

Hi, Could you explain more about the token exposing? Do you mean fire the notification from the token action module ?

univate’s picture

Conditional actions can already be setup to send an email on certain events (like order status changed)

You can insert various order tokens (replacement text) into these emails, if uc_affiliate2 exposed tokens for things like the commission value I was thinking it may be possible to create emails using this information.

univate’s picture

Status: Active » Needs review
StatusFileSize
new2.3 KB

Attached is a patch that adds some basic token support to uc_affiliate2.

I am only using 1 affiliate level, so this may need some work to support multiple levels.

wqmeng’s picture

univate

thank you for post your patch to the subject. After you talk of exposing affiliate2 to tokens, I have thought for a while and yes I agree that token may be more useful as Conditional actions may do more task than just send out email. Then I also found it is hard to expose multiple levels commission record to token system as token is a string-replace system in my mind and I can't find a way to send out emails to every affiliate in the multiple levels commission record.
I also find another way to send out email by job-queue module.
http://drupal.org/project/job_queue
And it is easy to work with, but it can only add one type job from the hard code. Which is limitation as some case we also need other actions than send out email. So I still want to find the way to get the affiliate2 token to work with the multiple levels commissions.

Thank you very much.

bojanz’s picture

Status: Needs review » Fixed
AlexisWilke’s picture

Status: Fixed » Needs work

Bojanz, Univate,

This patch adds a dependency on the tokens module (.info file):

dependencies[] = tokens

Thank you.
Alexis

bojanz’s picture

Shouldn't the dependency be "token" and not "tokens"?

Nevertheless, the module works fine with token disabled (the integration is optional), so I don't think the dependency is required.

AlexisWilke’s picture

bojanz,

You are correct! It is token. 8-)

I guess that if the module does not offer the use of tokens when the token module is disabled, then we should be fine. In that case, you may want to mark it as recommends:

recommends[] = token

Thank you.
Alexis

bojanz’s picture

Status: Needs work » Closed (fixed)

Noted.