Hi there,

I have some OG groups in my site. Each group is an online classroom.

The membership has a few fields (I use the default membership), and one of those fields is a select field with "approved" or "not approved" information about each student's final exam.

I would like to use rules to send an email to each student that change that OG membership field status to "approved". I want this workflow only for users of "exchange-student" role.

But I cannot do that because it seems that I didn't fetched the OG membership. I don't know what I'm doing wrong here.

This is my Rule:

Event:

After updating an existing og membership
After updating an existing user account

Conditions:

Entity has field: (Parameter: Entity: [og-membership], Campo: field_examen)
Data comparision: Parameter: Data to compare: [og-membership:field-examen, Data value: Aprobado

Action:

Fetch entity by id: Parameter: Entity type: Usuario, Identifier: [og-membership:id]
Provides variables: Membresía Alumno (membresia_alumno)
Send mail: Parameter: Para: [membresia-alumno:mail], Asunto: Aprobaste!, Mensaje: Hey, aprobaste!, Idioma: [membresia-alumno:language]

My problem is this rule won't send anything (it will send the email if I replace the parameter [membresia-alumno:mail] with a hardcoded email address).

What am I doing wrong? What am I missing?

Comments

Rosamunda’s picture

Update:
After reading the error logs, I get this:

Unable to evaluate action mail.
Unable to get variable membresia_alumno, it is not defined
Unable to evaluate action entity_fetch.
Unable to load user with id "2587"

It seems that the problem is that the user is not being fetched, because there's no user 2587. In fact, the user that I've updated while testing was number 76.

Rosamunda’s picture

Category: Task » Support request