أوتاد لتخصيص رسائل البريد الإلكتروني الملخصة والإشعارات

I have a client who would like to include ads in summary and notification emails. I’ve “crafted” a plugin that allows adding some text to the digest email (which I think needs some updating to catch up with changes made to that template).

I don’t like that I have to override the entire template to customize those emails.

Would it be possible to include a way to add to those emails without overriding the template?

The plugin works by having taking a topic ID in a custom field and including raw of the last post in the topic as the text added to the email (just before or after the header). Though I think it’s a pretty clever hack, that seems a bit too fiddly a solution to suggest adding to core. Perhaps there’s a way to have the Ad plugin be able to apply house ads to the digest and summary emails?

Managing a fragile plugin

Maybe I should write a spec that compares the digest email with the plugin off with the digest email with the plugin on but not configured to add anything to the email? Then I’d catch changes to the core template?

6 إعجابات

مرحباً جاي

هل تعمل هذه الإضافة مع Discourse 3.1؟ أو على الأقل تستحق التجربة؟

يمكنك تجربتها. لا أعتقد أنني سمعت منهم منذ هذه الرسالة، لذا أفترض أنهم لم يقوموا بالترقية منذ ذلك الحين.

يمكنك إخباري إذا كان معطلاً. من المحتمل ألا يكون لدي وقت لإصلاحه مجانًا، ولكني قد أفعل.

إعجابَين (2)

كما أفهم، فإن digest_custom_html و digest_custom_text تطبقان بالفعل خطافات لـ digest.html.erb و digest.text.erb. لذا فإن التنفيذ الأساسي لهذا الطلب سيتضمن إضافة المزيد من هذه الخطافات؟

يمكن أن يوفر التنفيذ الأكثر تقدمًا قوالب فرعية، والتي يمكن استخدامها لتزويد مؤلفي الإضافات برمز تنسيق وتصميم تحتفظ به Discourse.

هل أفهم بشكل صحيح أن تنفيذك سيكون ممكنًا مع إضافة digest_custom_html("before_preheader") واحدة إلى digest.html.erb؟

أعتقد ذلك. لم ألقِ نظرة فاحصة على كيفية عمله منذ سنوات.

مرحباً @thoka هل تمكنت من تطبيق أي شيء عبر هذه الخطافات؟ نحن نتطلع حاليًا إلى حقن بعض المقاطع الدعائية البسيطة عبر هذه الخطافات

لقد فعلت ذلك. طالما أنك تقوم بإنشاء الحقن الخاصة بك باستخدام html_safe، فأنت في وضع جيد.

هناك مناقشة في إصلاح digest_custom_html ليتم التعامل معه كـ HTML (كان: Overriding digest.html.erb)

إعجابَين (2)