I need to allow parents to authorize their children's participation in portions of a website's activities. I need to have one code sent per email automatically to a parent's email that is provided. I will have them use their child's login for the authorization piece.(Not ideal..but...)

I can tokenize the email going out and use Rules as to when to send it (when a child is under 18) - but, while I am seeing where I can enter codes manually, I am not seeing the token for including a code in an single email message so that it can (ostensibly) be generated automatically. I guess I should ask, can these codes be attached sequentially to a series of emails being sent..?

Any assistance is gratefully appreciated!

Comments

aidanlis’s picture

Hi, there is no on-demand generation of codes, however there is on-the-fly creation of codes using the dynamic module.

You could use rules to generate a string which matches the rules you define in the dynamic module, though I'm not sure how you'd do it exactly.

I'm not sure how your process works though. How are you collecting the parents emails? Are you using a custom module? If you're using a custom module to do this, then you can use the regcode_api to generate a code and mail it pretty easily.

cbear42’s picture

Hi -

Thanks so much for your reply.

Actually, I'm collecting the parent's email through a custom profile using a conditional field that displays if the user indicates they are under 18 years of age.
So, I have access through the field_id to that email address. Rules and Tokens are getting better and better at this stuff...but...it seems there are still some
limitations. Do you know of any docs around the dynamic sub-module or the regcode_api? I've got it turned on - and I can see how it can generate the regcodes dynamically - but it's where to go from there that's the issue.

Thanks for your answer - very, very appreciated! :-)

aidanlis’s picture

Status: Active » Fixed

Nope, no extra docs, you'll have to look at the source code. Sounds like you'll want to write a custom module that catches the registration (hook_user), generates a code (regcode_create), and emails it to the parent (drupal_mail).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

willzzz’s picture

Instead of any tokens, you just have to play with a regcode view and the insert view module. Draw a rule and insert the view in a "mail to an arbitrary mail adress". In this case, token is usefull for the mail adress.

Will