This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

Hugo

  • ****
  • 182 posts
"Save search" / Alerts; weekly instead of daily
« on: June 24, 2022, 09:52:22 PM »
Currently people receive their "saved searches" every day.

Is it possible to have this email sended only once a week? I am affraid that people will unsubscribe if it gets sended every day.

How do I adjust this?

Kind regards Hugo

*

Hugo

  • ****
  • 182 posts
Re: "Save search" / Alerts; weekly instead of daily
« Reply #1 on: June 28, 2022, 09:25:17 AM »
Hello,

Could someone help me with this problem or provide a solution?

Kind regards hugo

*

mwindey

  • *****
  • 465 posts
Re: "Save search" / Alerts; weekly instead of daily
« Reply #2 on: June 28, 2022, 10:44:57 AM »
@Hugo

In oc-includes/os-class file alerts.php look for:
Code: [Select]
 
$internal_name = 'alert_email_hourly';
  switch ($type) {
    case 'HOURLY':
      $internal_name = 'alert_email_hourly';
      break;
    case 'DAILY':
      $internal_name = 'alert_email_daily';
      break;
    case 'WEEKLY':
      $internal_name = 'alert_email_weekly';
      break;
    case 'INSTANT':
      $internal_name = 'alert_email_instant';
      break;
  }
Change first line from:
Code: [Select]
$internal_name = 'alert_email_hourly'; to
Code: [Select]
$internal_name = 'alert_email_weekly';

*

Hugo

  • ****
  • 182 posts
Re: "Save search" / Alerts; weekly instead of daily
« Reply #3 on: June 28, 2022, 11:11:52 AM »
Cool! but the emails are currently sended on a daily base. Wouldn't this mess things up? from hourly to weekly?

*

mwindey

  • *****
  • 465 posts
Re: "Save search" / Alerts; weekly instead of daily
« Reply #4 on: June 28, 2022, 11:24:21 AM »
@Hugo,

Is your cron set on a daily base only maybe? As it is set now in the file it should send email every hour with cron hourly but only in case there is something that has been changed to the user settings else it will use daily base cron execution.
As far as i can see it shouldn't mess things up... On my website this is set as provided and for me this works.
Anyway you can always reverse if it doesn't act as expected  ;)

*

MB Themes

Re: "Save search" / Alerts; weekly instead of daily
« Reply #5 on: June 28, 2022, 06:59:34 PM »
Osclass currently does not allow to set frequency, it set iit to daily by default.
I do not remember where this value is set, but at start try to just change frequency in database to weekly.
If it helps, then you can search where default value is set
It seems like good idea to be able to change frequency in user account
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on June 29, 2022, 03:25:42 PM
*

mwindey

  • *****
  • 465 posts
Re: "Save search" / Alerts; weekly instead of daily
« Reply #6 on: June 29, 2022, 10:17:09 AM »
@MB themes / @Hugo

I have changed the value in t-alerts to WEEKLY and looks like this is the correct way to do it.
Value gets set in folder oc-includes/osclass/model file Alerts.php on line 347 there is
Code: [Select]
public function createAlert($userid, $email, $alert, $secret, $type = 'DAILY')
Changed to:
Code: [Select]
public function createAlert($userid, $email, $alert, $secret, $type = 'WEEKLY')

Every time a new alarm is created it is now standard on WEEKLY base in db field e_type ...

*

MB Themes

Re: "Save search" / Alerts; weekly instead of daily
« Reply #7 on: June 29, 2022, 03:25:55 PM »
@mwindey
Glad to hear that ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

rooman

  • ****
  • 223 posts
Re: "Save search" / Alerts; weekly instead of daily
« Reply #8 on: June 30, 2022, 02:12:31 PM »
@mwindey
Glad to hear that ;)


We hope to add this feature in the next update
Because if you update to the new version and it is not approved
You have to enter this again
If the official thinks that the topic is important, I hope to add it to the next update

*

MB Themes

Re: "Save search" / Alerts; weekly instead of daily
« Reply #9 on: June 30, 2022, 04:23:37 PM »
Yes that is destiny of custom mods or updates.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Dan

  • ***
  • 53 posts
Re: "Save search" / Alerts; weekly instead of daily
« Reply #10 on: July 05, 2022, 11:29:01 PM »
@ Mwindey

Thank you so much
MB theme should employ you

I am requesting how to set general Cron job path