2012-06-26 12 views
5

यह स्वचालित रूप से ईमेल जो कहते हैंमैं मेलबॉक्सर ईमेल के टेम्पलेट को कैसे अनुकूलित कर सकता हूं?

You have a new message: subject 

     You have received a new message:  


     Body  

     Visit http://example.com/ and go to your inbox for more info 

कोई भी इस टेम्पलेट को अनुकूलित करने के लिए कैसे जानता है बचाता है? यदि संभव हो, तो मैं इस टेम्पलेट फ़ॉर्म के लिए i18n का उपयोग करना चाहता हूं।

धन्यवाद !! ।

+0

https://github.com/ging/mailboxer#i-need-a-gui –

+0

धन्यवाद, लेकिन यह ईमेल टेम्पलेट के बारे में बात की तरह नहीं दिखता। – MKK

+0

मुझे विश्वास है कि यह वही है जो आप ढूंढ रहे हैं: http://stackoverflow.com/questions/11303303/anyone-can-think-of-any-way-to-customize-email-mailboxer-gems-template-view-o – monika92

उत्तर

8

आप मेल कि rails g mailboxer:views उपयोगकर्ता के लिए भेजा जाता इस <your rails app>/app

1- notification_mailer - containing template files when a notification is sent to a user

2- message_mailer - containing template files when a message is sent to a user

आप बदल सकते हैं में दो अलग अलग फ़ोल्डरों उत्पन्न होगा के लिए विचारों को उत्पन्न करने की जरूरत है उन टेम्पलेट्स।

एक और बात आप कर सकते हैं कि uncomment//config/initializer/mailboxer.rb

config.notification_mailer = CustomNotificationMailer 
config.message_mailer  = CustomMessageMailer 

में इन पंक्तियों को जोड़ने और दो मेलर्स वर्गों ऊपर बनाने के लिए जो

send_email 

इस समारोह के लिए मानकों को निम्नलिखित फ़ंक्शन अवश्य होना चाहिए है और उनके कार्यान्वयन इस लिंक पर दिया गया है। आपको अपना खुद का send_mail फ़ंक्शन लिखने का संकेत मिलेगा।

Notification Mailer Send Email function

Message Mailer Send Email function

+0

तथ्य यह है कि आपके मेलर्स में 'send_mail' नामक फ़ंक्शन होना आवश्यक है, और यहां से इंटरनेट एपर्ट पर कहीं और दिखाई नहीं देता है। धन्यवाद। – stephenmurdoch

संबंधित मुद्दे

 संबंधित मुद्दे