Hi primehalo,
I'd like to get all known bugs squashed before attempting to submit it to the extensions database.joshwh88 wrote: ↑Wed Aug 15, 2018 3:08 pm Thanks for the update. It fixed the email problem, though I still can't see the settings in the UCP for a new user and users that registered after the install of the beta7 version (again, this problem is not an issue for me - just thought I'd mention it). But seeing as though you can't replicate this its probably something on my end causing this.
Thanks again!
Code: Select all
$user_notifications = $this->get_user_notifications($user_id);
$user_post = !empty($user_notifications['primehalo.primenotify.notification.type.post'][0]['notify']) || !empty($user_notifications['primehalo.primenotify.notification.type.topic'][0]['notify']);
$user_pm = !empty($user_notifications['primehalo.primenotify.notification.type.pm'][0]['notify']);
user_id
and then see if primehalo.primenotify.notification.type.post/topic is there in the item_type
column, and if it is then if notify
is set to 1.Code: Select all
$show_enable_post = ($this->config['primenotify_enable_post'] == prime_notify::USER_CHOICE) && $user_post;
$show_enable_pm = ($this->config['primenotify_enable_pm'] == prime_notify::USER_CHOICE) && $user_pm;
$show_keep_bbcodes = $this->config['primenotify_keep_bbcodes'] == prime_notify::USER_CHOICE;
$show_always_send = ($this->config['primenotify_always_send'] == prime_notify::USER_CHOICE) && $user_post;
config_name
column that starts with primenotify_ and if the value is 2 then it's set for User's Choice.New email templates located inside the language directory of this extension.LoRoller wrote: ↑Thu Aug 16, 2018 1:34 am We just got a request for this feature today and am happy to see your project at such an advanced state.
I had to modify the various notification emails from our board because our host (GoDaddy) decided that the subjects of the mails (for admin messages, posts and private messages) looked too much like spam and trashed them on the way out. Does your system replace the existing email templates or add new ones? I'll need to know where they are to modify them, assuming you retained the original subjects.
Thanks!
No need to hook in the templates, that's automatic.
Code: Select all
/**
* Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options)
*
* @return bool True/False whether or not this is available to the user
*/
public function is_available()
{
return true;
}
Code: Select all
/**
* Get email template
*
* @return string|bool
*/
public function get_email_template()
{
return false;
}
When I was talking about the extension's notification options I was referring to the options which I currently have displayed in the UCP > Board preferences > Edit global settings section:3Di wrote: ↑Thu Aug 16, 2018 10:59 pmNo need to hook in the templates, that's automatic.
Add this function in your notifications's type(s), like here: https://github.com/primehalo/primenotif ... st.php#L32You should probably set the language key for those, if not already done.Code: Select all
/** * Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options) * * @return bool True/False whether or not this is available to the user */ public function is_available() { return true; }
Proof of concept: http://prntscr.com/kjjo6o
I tried that originally and it didn't work which is why I figured I had to do the custom approach. I just tried it again and it still isn't working. It only seems to look in the board's default language path and not the extension's language path. To test again I gave my email template a unique name, primenotify_topic_notify.txt (in testboard/ext/primehalo/primenotify/language/en/email) and then returned3Di wrote: ↑Thu Aug 16, 2018 10:59 pm There is also another function you are not using there..Which should help you out, instead of using a custom approach.Code: Select all
/** * Get email template * * @return string|bool */ public function get_email_template() { return false; }
'primenotify_topic_notify'
from get_email_template()
which I added in my testboard/ext/primehalo/primenotify/notification/type/post.php file. When I try it out I get the message "Unable to find template "primenotify_topic_notify.txt" saying that it looked into testboard/language/en/email directory.