开发者

Radiant mailer and flash message

I'm using Radiant with the mailer extension to provide a contact form on my website.

I'd like to display a nice "开发者_运维知识库your email has been successfully sent" message after sending the email.

However Radiant seems to only allow redirect in it's configuration. Not to define flash messages.

Would you know of a way to define flash messages via the radiant mailer extension ?


Okey, I've been digging and resolved my problem with the following :

After sending an email, the redirected page has the anchor #mailer. So with a bit of javascript, I detect the presence of that anchor and I display the "thanks for your email" message".

Here's my code (using JQuery)

<script type="text/javascript">
    $(document).ready(function() {
        $('#flash').hide();
        if (window.location.href.match(/\#mailer/)) {
            $('#flash').html('Enter the message here');
            $('#flash').fadeIn(3000);
        }
    });
</script>

<div class="flash"></div>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜