Hi, thanks for your module.
could you please add support for rules?

I would like to have the option in rules "send gift[gift id]"
so after then I can through rules programmatically send some gift to some users as a award (e.g. when they will create some node, or on their birthdays etc).

thanks
Igor

CommentFileSizeAuthor
#19 Screen Shot 2016-09-16 at 22.23.29.png98.5 KBigorik

Comments

igorik created an issue. See original summary.

igorik’s picture

Issue summary: View changes
drupalprojects’s picture

Assigned: Unassigned » drupalprojects

  • drupalprojects committed fd9c247 on 7.x-1.x
    Issue #2646926 by igorik,drupalprojects: Initial support for RULES
    
drupalprojects’s picture

Initial support for rules module added.

You can find an additional action in Node Gift group - Send gift.
It has 4 params: Sender of the Gift, receiver of the gift, gift node and comment
For params Sender and Gift node you should switch to direct input and insert user id and node id as numbers. For now I can't find a way to load node and user params as regular Drupal autocomplete fields. It only allow to autocomplete from current action scope.

Also it may be a good idea to add an additional action BEFORE sending gift which adds few Userpoints to sender (Admin probably?) as each gift costs some userpoints.

igorik’s picture

Wau, it was so fast, thank you!
I am very looking forward to test it.

igorik’s picture

I tested it, it works, thanks.
Chosen user recieved the gift (when he created his first blog).

One bug I found there - the userpoints was taken from gifted users, not from the donor - gifted user saw the message that she spend 100 user points.
Please check it.

Thanks
Igor

drupalprojects’s picture

One bug I found there - the userpoints was taken from gifted users, not from the donor - gifted user saw the message that she spend 100 user points.
Please check it.

Fixed.

igorik’s picture

Hello,
would be great to have in rules an action (React on event)
"Gift was send".
Based on this I can e.g. to add Google analytics event to track user activity

Thank you very much ahead.
Igor

drupalprojects’s picture

I will try to implement it in few days.

  • drupalprojects committed ed2860f on 7.x-1.x
    Issue #2646926 by igorik,drupalprojects: Added Gift Sent Rules event
    
drupalprojects’s picture

Status: Active » Needs review

Done. Enjoy!

igorik’s picture

thank you, this is partially working.
I can really use action "Gift sent"
but I am missing some data value for the gift "who sent it, who recieved it, name/type of the gift",

without it it is not very usable to use this action.
e.g. I can't send the notification to user who recieved the gift, because I don't know who it is, etc.

Thank you
Igor

  • drupalprojects committed 0bd35cb on 7.x-1.x
    Issue #2646926 by igorik,drupalprojects: Fixed variables issue in Gift...
drupalprojects’s picture

Fixed issue with variables in Gift sent event

igorik’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, it works like a charm.
Maybe you could add there too the message from the recipient.
Thank you!

  • drupalprojects committed eca2bf7 on 7.x-1.x
    Issue #2646926 by igorik,drupalprojects: Added comment variable to Gift...
drupalprojects’s picture

Added sender's comment to gift sent event

igorik’s picture

StatusFileSize
new98.5 KB

Is the type=>'text' really correct?
'comment' => array('type' => 'text', 'label' => t('Gift comment'));
couldn't be it more like:
'comment' => array('type' => 'comment', 'label' => t('Gift comment')),

because I don't know how to target type 'text' using entity reference, picture attached.

drupalprojects’s picture

Not sure what are you trying to do. Comment is not a node's comment - its just a piece of text which is stored in nodegift table.

igorik’s picture

Status: Reviewed & tested by the community » Fixed

The last issue was fixed by this patch:
https://www.drupal.org/node/2826445#comment-11773686

drupalprojects’s picture

Status: Fixed » Closed (fixed)