Search

Hi all,

I'm having a bit of trouble getting the $etm-recipient value to come through on a project I'm working on using ETM. The email form posts successfully to the Symphony section. The etm-entry-id is being created with no problem:

    <etm-entry-id>12167</etm-entry-id>

Events Debug Feedback

However, I'm getting this feedback in my /data/events that has me buffing my bald head to something just shy of radiant:

<events>
    <member-login-info logged-in="yes" id="497" result="success" />
    <contact-by-person id="12167" result="success" type="created">
        <filter name="permission" status="passed" />
        <filter name="recaptcha" status="passed" />
        <filter name="etm-contact-staff-person" status="failed" total="1" sent="0" />
        <message>Entry created successfully.</message>
        <post-values>
            <to>497</to>
            <sender-name>will</sender-name>
            <sender-email>XXXX@gmail.com</sender-email>
            <subject>test</subject>
            <message>test</message>
            <date-sent>2012-02-28 22:17</date-sent>
            <owner>4297</owner>
            <active>No</active>
            <originating-page>http://flo.pcpc.dev/forms/contact-us/contact-by-person/?dev=debugForm</originating-page>
            <ip-address>127.0.0.1</ip-address>
        </post-values>
    </contact-by-person>
</events>

ETM Specific Form Fields

input#etm-recipient is populated via javascript with the member-id of the staff person contained in the Members section upon user selection.

    <input name="etm[sender-email]" value="fields[sender-email]" type="hidden"/>
    <input name="etm[sender-name]" value="fields[sender-name]" type="hidden"/>
    <input name="etm[subject]" value="fields[subject]" type="hidden"/>
    <input name="etm[body]" value="fields[message]" type="hidden"/>
    <input id="etm-recipient" name="etm[][recipient]" type="hidden"/>

Basic Settings and Statuses

  • Symphony 2.2.5
  • Members 1.1.1
  • ETM 3.0
  • Development Machine: Mac OS 10.7.3, Litespeed, PHP 5.3.8, MySQL 5.x

Sources Referenced

While I've read through all of the following, I may very well have missed something. This is where I hope you can help.

Can you try this:

<input id="etm-recipient" name="etm[recipient][]" type="hidden" />

I do not have acces to my laptop right now, and typing on my phone is a pain, so please forgive me for the short answer.

I haven't used ETM myself, but this line looks odd:

<input id="etm-recipient" name="etm[][recipient]" type="hidden"/>

I have a feeling this should be:

<input id="etm-recipient" name="etm[recipient][]" type="hidden"/>

Doh beaten ;)

First, thank you creativedutchman and brendo, for your replies.


I changed

<input id="etm-recipient" name="etm[][recipient]" type="hidden"/>

to

<input id="etm-recipient" name="etm[recipient][]" type="hidden"/>

with this resultant fatal error:

Fatal error: Call to a member function get() on a non-object in /Users/wjn/Sites/pcpc.org/subdomains/flo/public/extensions/email_template_manager/lib/class.emailtemplate.php on line 246

Resolved (2012-02-29 4:03 pm)

I'm not sure what cured this particular ailment; however, @animaux mentions that he solved a similar issue by remaking the email template. That seems to have done the trick for the Fatal error. I still am having no luck sending email. Please see posts below.

I also believe that when the email template does not have the parameters it wants this error happens.

FYI: @creativedutchman instructs @bauhouse to use this:

<input name="etm[][recipient]" type="hidden"/>

instead of this:

<input name="etm[recipient][]" type="hidden"/>

$_POST output

Here's a var_dump() of my contact form submission. The [fields][to] value is the username from the Members Extension, which is also the value of [etm][recipient][0].

array(7) {
  ["filter-to"]=>
  string(17) "Enter filter text"
  ["fields"]=>
  array(10) {
    ["to"]=>
    string(3) "wjn"         // Member Username
    ["sender-name"]=>
    string(4) "will"
    ["sender-email"]=>
    string(19) "xxxxxx@gmail.com"
    ["subject"]=>
    string(4) "test"
    ["message"]=>
    string(4) "test"
    ["date-sent"]=>
    string(16) "2012-02-29 15:52"
    ["owner"]=>
    string(3) "497"
    ["active"]=>
    string(2) "No"
    ["originating-page"]=>
    string(69) "http://flo.pcpc.dev/forms/contact-us/contact-by-person/?dev=debugForm"
    ["ip-address"]=>
    string(9) "127.0.0.1"
  }
  ["etm"]=>
  array(5) {
    ["sender-email"]=>
    string(20) "fields[sender-email]"
    ["sender-name"]=>
    string(19) "fields[sender-name]"
    ["subject"]=>
    string(15) "fields[subject]"
    ["body"]=>
    string(15) "fields[message]"
    ["recipient"]=>
    array(1) {
      [0]=>
      string(3) "wjn" // from the [fields][to] above
    }
  }
}

Question

It is my understanding that ETM expects the username when working with the Members Extension. Is this the case? If not what does it need to email a member?

Ah, I think I know what is going on here; the form stuff is no longer in use - you should use the backend to configure the recipient, subject and contents.

The other instructions are for the previous version. Sorry for the confusion.

@creativedutchman essentially what I'm trying to do is to have users select the staff person they would like to contact and send an inquiry. The contact-us-message-by-id DS pulls in fine off the $etm-entry-id; however, I'm having trouble getting the recipient to work. The filter tells me "Can not send an email to nobody, please set a recipient."

Could you help me see what I'm doing wrong?

ETM Email Template

etm config

Debug feedback

<events>
    <member-login-info logged-in="yes" id="497" result="success" />
    <contact-by-person id="12208" result="success" type="created">
        <filter name="permission" status="passed" />
        <filter name="etm-contact-staff-person" status="failed">Can not send an email to nobody, please set a recipient.</filter>
        <message>Entry created successfully.</message>
        <post-values>
            <to>xxxxxx@pcpc.org</to>
            <sender-name>Will</sender-name>
            <sender-email>xxxxxx@gmail.com</sender-email>
            <subject>Testing ETM</subject>
            <message>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis.</message>
            <date-sent>2012-02-29 16:49</date-sent>
            <owner>497</owner>
            <active>No</active>
            <originating-page>http://flo.pcpc.dev/forms/contact-us/contact-by-person/?dev=debugForm</originating-page>
            <ip-address>127.0.0.1</ip-address>
        </post-values>
    </contact-by-person>
</events>
...
<contact-us-message-by-id>
    <section id="23" handle="contact-us-log">Contact Us Log</section>
    <entry id="12208">
        <date-sent time="16:49" weekday="3">2012-02-29</date-sent>
        <message>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis.</message>
        <sender-email handle="xxxxxx-gmailcom">xxxxxx@gmail.com</sender-email>
        <sender-name handle="will">Will</sender-name>
        <subject handle="testing-etm">Testing ETM</subject>
        <to handle="willnielsen-pcpcorg">xxxxxx@pcpc.org</to>
    </entry>
</contact-us-message-by-id>

Your Datasource is called "Contact US Message by ID", but in your recipients XPath you write contact-us-by-message-id. That can't work.

one word, @michael-e: DUH!

Thanks for your good eye. All is working well now.

Great!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details