Hi,
First of all thanks for this awesome app.
I need some help to show "your message has been sent page" after user sends email instead of redirecting flow to inbox.
I am going through the code base for few days now but couldn't figure out way to do it.
Is it doable ?
How can we accomplish this?
Thanks in advance.
The best way would be to code a plugin, I think you could use the message_sent hook http://trac.roundcube.net/wiki/Plugin_Hooks#message_sent and some javascript to redirect to a "message sent" page.
Quote from: skaero;36631The best way would be to code a plugin, I think you could use the message_sent hook Plugin_Hooks (http://trac.roundcube.net/wiki/Plugin_Hooks#message_sent) and some javascript to redirect to a "message sent" page.
Thanks for the reply.
$this->add_hook('message_sent', array($this, 'show_msgsent'));
public function show_msgsent($args)
{
$rcmail = rcmail::get_instance();
$rcmail->output->send("custompages.msgsent");
return $args;
}
This doesn't shows msgsent page, I couldn't understand where & how to use Js.
Please help.
@bhu1st:
I've mailed you a solution. Please post your testing results when done.
Thanks a lot Rosali.
Code you sent worked great.
Plugin Class:
class message_sent extends rcube_plugin {
function init() {
$rcmail = rcmail::get_instance();
//add a plugin hook "message_sent"
//Details: [url=http://trac.roundcube.net/wiki/Plugin_Hooks#message_sent]Plugin_Hooks[/url]
$this->add_hook('message_sent', array($this, 'show_msgsent'));
//register a custom action - plugin.msgsent
$this->register_action('plugin.msgsent', array($this, 'redirect'));
//handlers to processes the placeholder tags in message sent template
$this->register_handler('plugin.body', array($this, 'get_body'));
}
/**
* Get content to display
*
* @param void
*
* @return string content
*/
function get_body() {
return "Your message has been sent!";
}
/**
* Action displays message sent template
*
* @param void
*
* @return void
*/
public function redirect() {
$rcmail = rcmail::get_instance();
$rcmail->output->set_pagetitle('Message Sent');
$rcmail->output->send('message_sent.msgsent');
}
/**
* Callback redirects to plugin.msgsent action
*
* @param array $args Default hook parameters.
*
* @return void
*/
public function show_msgsent($args) {
$rcmail = rcmail::get_instance();
echo '<script type="text/javascript"> parent.location.href="./?_task=mail&_action=plugin.msgsent" </script>';
//abort
$rcmail->output->send('iframe');
}
}
msgsent.html template:
----------------------
Was it just fast coding or did you miss localization?
I would not use hard coded localizations ('Message Sent' / 'Your message has been sent!') ...
$this->add_texts('localization', [true ... if labels should be passed to GUI || false]); ... $this-gettext(...)
Thanks :)
Hi,
This code works fine in Chrome and Firefox however it is giving me "Permission Denied" error in IE 8
Function.js (/skins/default/function.js Line : 509 Char: 3).
var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null;
Message is sent but page freezes at compose action.
How to fix this ?
Is anyone having similar issue in Js redirection in IE ?
Please help me.
Works for me with IE9.
Thanks for the reply,
I am having problem in IE8 - roundcube just freezes.
Could you suggest what's wrong in the above code in IE8 please ?
It works for me on IE8 as well.
Do you have a test account for me (myroundcube at mail4us dot net)?