Anything in the initialiers directory should be automatically loaded.
A very simple way to test if the files are loading is to put a line in
the top of the smtp_tls.rb & smtp_config.rb files. Something like:
puts "Loading Config...." and "Loading TLS Extension..."
If it prints out those two lines, then the files are being loaded. If
it doesn't, then in environment.rb, you need to do something like
require "config/initializers/smtp_tls"
require "config/initializers/smtp_config"
With raise_deliver_errors turned on, it should be showing you some
error messages. You may be correct in thinking the files are not
being loaded.
Doug
On Mar 22, 2009, at 4:14 AM, Shaolo wrote:
Well, here are what my files look like:
smtp_config.rb:
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.smtp_settings = {
:tls => true,
:address => "smtp.gmail.com",
:port => 587,
:domain => "dejavubeauty.com",
:authentication => :plain,
:user_name => "[email protected]",
:password => "****************"
}
smtp_tls.rb:
It's the bit from github cut and pasted.. Kind of long to put in the
email.
Those are both in the config/initializers/ directory that I created.
Do I need to do something special to load them?
This is the "mailer" part from the mail page:
subject: "Test" from_field: email redirect_to: /contact/thankyou
recipients:
- [email protected] - [email protected]
This is the "email" part from the mail page:
Name: <r:mailer:get name="name"/> E-mail: <r:mailer:get name="email"/>
Subject: <r:mailer:get name="subject"/> Message: <r:mailer:get
name="message"/>
This is the "body" part from the mail page:
<r:mailer:form name="contact"> <fieldset> <legend>Enter your contact
information and message.</legend> <r:if_error on="name"><span>Name is
required.</span></r:if_error> <label for='name'>Name</label><br>
<r:text
name="name" required="true"/><br> <r:if_error on="email"><span>Email
is
required.</span></r:if_error> <label for='email'>Email</label><br>
<r:text
name="email" required="true"/><br> <r:if_error
on="subject"><span>Subject is
required.</span></r:if_error> <label for='subject'>Subject</label><br>
<r:text name="subject" required="true" value="DejaVu - "/><br> <label
for='message'>Message</label><br> <r:if_error
on="message"><span>Message is
required.</span></r:if_error> <r:textarea name="message"
required="true"/><br> <input type="submit" value="Send"> </fieldset>
</r:mailer:form>
This is the output from production.log:
Processing MailController#create (for 76.115.250.46 at 2009-03-22
02:27:50)
[POST]
Session ID:
BAh7CDoMY3NyZl9pZCIlMWRmYThlYmJhZGU0MmRiYzYzNzNiNmI2OWJiMjc1
NWEiDHVzZXJfaWRpBiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxh
c2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA==--
b068953efde7c39050f2430a6ef6437618778ddd
Parameters: {"action"=>"create", "page_id"=>"22",
"mailer"=>{"required"=>{"name"=>"true", "subject"=>"true",
"message"=>"true", "email"=>"true"}, "name"=>"Shawn Wilton",
"subject"=>"DejaVu - ", "message"=>"Test",
"email"=>"[email protected]"},
"controller"=>"mail"}
Sent mail to [email protected], [email protected]
Completed in 0.87075 (1 reqs/sec) | Rendering: 0.00120 (0%) | DB:
0.00602
(0%) | 200 OK [http://dejavubeauty.com/pages/22/mail]
Processing SiteController#show_page (for 76.115.250.46 at 2009-03-22
02:27:51) [GET]
Parameters: {"url"=>["styles.css"], "action"=>"show_page",
"controller"=>"site"}
Completed in 0.11793 (8 reqs/sec) | DB: 0.00217 (1%) | 200 OK [
http://dejavubeauty.com/styles.css]
Does anyone see anything wrong with any of that? It still fails to
send
emails, but there's no errors in the log. It also fails to redirect
to the
"thankyou" page. But that's probably because it's failing to send
the email.
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant
===
Doug Bryant
[email protected]
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant