ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Using ee standard global variables in php...

February 23, 2010 6:03am

Subscribe [2]
  • #1 / Feb 23, 2010 6:03am

    steve.sweetland

    35 posts

    Basically i need to do a manual notification, so im using php mail().

    I want to include {screen_name} in the body of the email, but it seems that neither stage of php parsing will cause ee to parse the variable.

    I tried

    - directly embedding {screen_name} into the body.
    - setting a php variable first, then embedding the php var in the body
    - putting the php notification in an template embed and passing over an embed variable… and repeating the above steps.

    In all cases, the variable isnt on the email, but will render on the template.

    I figure im misunderstanding exactly how the tag parsing works, but could do with a kick in the right direction, any ideas?

    [Mod Edit: Moved to the How to forum]

  • #2 / Feb 23, 2010 1:00pm

    steve.sweetland

    35 posts

    why didnt i post this in the technical area? cause i was being cretinous.

    apologies.

  • #3 / Feb 23, 2010 1:01pm

    steve.sweetland

    35 posts

    Basically i need to do a manual notification, so im using php mail().

    I want to include {screen_name} in the body of the email, but it seems that neither stage of php parsing will cause ee to parse the variable.

    I tried

    - directly embedding {screen_name} into the body.
    - setting a php variable first, then embedding the php var in the body
    - putting the php notification in an template embed and passing over an embed variable… and repeating the above steps.

    In all cases, the variable isnt on the email, but will render on the template.

    I figure im misunderstanding exactly how the tag parsing works, but could do with a kick in the right direction, any ideas?

  • #4 / Feb 23, 2010 3:40pm

    Ingmar

    29245 posts

    {screen_name} is only available in a regular template. It refers to the currently logged-in user. There is no built-in way to include arbitrary variables in your mail, I am afraid.

  • #5 / Feb 24, 2010 10:18am

    steve.sweetland

    35 posts

    okeydoke… looks like ill be querying for it then!

    cheers for the straight answer 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases