I have this question tied into another post but thought I'd start a new one. I purchased the ebook (great BTW) BUT I'm having trouble getting this to work. On page 53 it talks about using radio buttons to determine who gets the email. Of course, radio buttons aren't practical for me so I'm using a drop down. I can't get it to work at all - it doesn't send emails. Has anyone tried this and gotten it to work? Here is what I have:
So this creates my dropdown. Now here is the code to format the email to who portion. NOTE: this has been placed in the "On submit code-before sending emails":
Also note that where it states "email_to_use", per the ebook, I've added this text to a dynamic to field in the setup emails tab. Form is also set to email. And yes, I've been able to get a regular form to send with no issue.
Any ideas? I'm on a crunch to complete this so any direction you can point me is appreciated.
<select class="cf_inputbox validate-selection" id="select_3" size="1" name="select_3">
<option value="">Choose Option</option>
<option value="78002" title="state rep 1">78002</option>
<option value="78006" title="state rep 2">78006</option>
</select>
So this creates my dropdown. Now here is the code to format the email to who portion. NOTE: this has been placed in the "On submit code-before sending emails":
<?php
$select_3 = JRequest::getString('select_3', '', 'post');
$emails = array (
'78002'=>'email1@yahoo.com',
'78006'=>'email2@thatsunique.com',
'78009'=>'email3@gogreencre8tive.com'
);
$email_to_use = $emails[$select_3];
JRequest::setVar('email_to_use', $email_to_use);
?>
Also note that where it states "email_to_use", per the ebook, I've added this text to a dynamic to field in the setup emails tab. Form is also set to email. And yes, I've been able to get a regular form to send with no issue.
Any ideas? I'm on a crunch to complete this so any direction you can point me is appreciated.
Hi prdg1,
I've just copied your code snippets (plus a submit button) into a new form and is working perfectly. What do you see in the DeBug output?
Bob
I've just copied your code snippets (plus a submit button) into a new form and is working perfectly. What do you see in the DeBug output?
Bob
Good morning Bob.... hmmm I'm just at a loss cause everything looks right to me too. Ok here is the debug info.
_POST: Array ( [select_3] => 78002 [text_8] => As a concerned citizen that supports preventing child abuse and neglect and juvenile delinquency, I am deeply alarmed by the news that the Department of Family and Protective Services proposed an 84% reduction to prevention and early intervention programs to meet the agency 10% budget reduction. This is a truly harrowing proposal with multigenerational consequences for the roughly 70,000 children in Texas confirmed as victims of child abuse. The age old saying, “an ounce of prevention is worth a pound of cure” is a cliché because it is proven time and time again. The University of Houston found that each year, the effects of child abuse cost Texans roughly $6.25 billion dollars a year. Conversely, quality prevention and intervention programming has the potential to yield a return of $5 for every $1 spent while improving the lives of thousands of children. The annual budget for prevention programs is only $45 million and Texans can ill afford the cost of providing for additional abused children. Reducing the prevention and early intervention programs will ultimately cost Texas money. Children are one of the most vulnerable populations in the world. Reductions in prevention and early intervention programs will only serve to ensure the roughly 70,000 confirmed victims of child abuse do not realize their full potential because they are more likely to participate in at-risk behaviors. Studies show parents abused as children are high risks for abusing their own children creating a vicious cycle. Programs through prevention and early intervention reduce the occurrence of child abuse and help teach parents how to gain self-sufficiency so they can raise successful children. The 84% reduction in prevention and early intervention programs is not an acceptable measure. We urge you to use your leadership to thwart the reduction simultaneously defending children from the trauma and tragedy of child abuse. Please prioritize prevention and early intervention programs. Sincerely, [text_9] => patsy test [text_12] => patsy_caldwell@aidmatrix.org [8fffc59ff0c384dc91af0376ea36da15] => 1 )
Your thank you message here.
Let me throw this out there. Is it possible that the server is not allowing the email to be sent because the dynamic to field is not recognizable since it doesn't have the extension for this clients mail program? If so, what would I need to possibly have the client do in order to allow these emails to be sent?
Hi prdg1,
Please post **all** of the Debug Info. The $_POST array helps a little but the messages and dummy email are more useful.
Bob
Please post **all** of the Debug Info. The $_POST array helps a little but the messages and dummy email are more useful.
since it doesn't have the extension for this clients mail program
I don't know what that means?Bob
It is on in there. Is there somewhere else I can check. This is very very strange.
UPDATE: Ok so I did a series of tests. It seems like it doesn't like this code:
The reason I say that is I just removed all this, got rid of the "dynamic to" field and just used a "to" field with my email address. The debug presented all the code including the email AND I actually received the email.
So there's something about using a drop down or is it the dynamic to field that isn't working here for this. Any ideas? "select_3" is the id for my dropdown in case you needed to know ......
I may have to just do this the old fashioned way and create a PHP form by scratch but I really like the ease of the tool. Anyway, let me know. Thanks again for all your help. You really are the best support guy ever - not like you have other things to do - right?
UPDATE: Ok so I did a series of tests. It seems like it doesn't like this code:
<?php
$select_3 = JRequest::getString('select_3', '', 'post');
$emails = array (
'78002'=>'email1@yahoo.com',
'78006'=>'email2@thatsunique.com',
'78009'=>'email3@gogreencre8tive.com'
);
$email_to_use = $emails[$select_3];
JRequest::setVar('email_to_use', $email_to_use);
?>
The reason I say that is I just removed all this, got rid of the "dynamic to" field and just used a "to" field with my email address. The debug presented all the code including the email AND I actually received the email.
So there's something about using a drop down or is it the dynamic to field that isn't working here for this. Any ideas? "select_3" is the id for my dropdown in case you needed to know ......
I may have to just do this the old fashioned way and create a PHP form by scratch but I really like the ease of the tool. Anyway, let me know. Thanks again for all your help. You really are the best support guy ever - not like you have other things to do - right?
I'm at a loss here. Any ideas on what could be causing this not to send? It really looks like it doesn't like the "dynamic to" field. Is there something on the server you think I can check? I may just try hard coding a form with a PHP processor and see if it will work that way and just put it in the Joomla wrapper. It just seems odd that this isn't working in the dynamic to field. Again thanks for all your help. As usual, you're great!😀
This topic is locked and no more replies can be posted.