21 lines
679 B
JavaScript
21 lines
679 B
JavaScript
/**
|
|
* Email Configuration Plugin - Client Side
|
|
*/
|
|
if (window.rcmail) {
|
|
rcmail.addEventListener('init', function(evt) {
|
|
rcmail.register_command('email_config_open', function() {
|
|
rcmail.http_post('plugin.email_config_generate_url', {},
|
|
rcmail.set_busy(true, 'loading'));
|
|
}, true);
|
|
});
|
|
|
|
rcmail.addEventListener('responseafterplugin.email_config_generate_url', function(response) {
|
|
rcmail.set_busy(false);
|
|
if (response && response.url) {
|
|
window.open(response.url, '_blank');
|
|
} else {
|
|
rcmail.display_message('Failed to generate configuration URL', 'error');
|
|
}
|
|
});
|
|
}
|