Jump to content

Admin Home Page Widget for Upcoming Hosting Renewals v6 template


caisc

Recommended Posts

Sorry to revive an old topic.  I've implemented this and it's absolutely brilliant.  I modified it to simply show the User, Billing Cycle, Next Due Date and the Amount, just to give myself a brief overview of the expected income in the weeks ahead.

Would it be difficult to create a similar SQL Query to list the email sent over the past week or so ?  Sometimes it's good to have visibility on what reminders have been sent.  Is there a KB article on the Database Structure that would help me to formulate my own SQL Query ?

Link to comment
Share on other sites

20 minutes ago, championc said:

Would it be difficult to create a similar SQL Query to list the email sent over the past week or so ? 

no - for system emails, it's just a basic query to tblemails, reverse sort by date, and give it two dates (or I suppose a period of time and use today and today minus that given period, e.g week) - it's basically what the Email System Log currently does - except you can't filter that by date; for domain reminders emails dates, they're stored in tbldomainreminders.

24 minutes ago, championc said:

Sometimes it's good to have visibility on what reminders have been sent. 

you can see which domain reminders have been sent, for any given period, by running the "Domain Renewal Reminder Emails" report.

33 minutes ago, championc said:

Is there a KB article on the Database Structure that would help me to formulate my own SQL Query ?

detailed documentation with WHMCS... I fear not. .. the above report isn't encrypted, so that might give you some clue to the reminder query...  last year I posted a homepage panel hook to show a client's email history to them and I posted the basic Capsule query...

in your case, you don't need the first where (as you want all clients) and you just need to add a date range... many ways to do that, e.g whereBetween using 2 given dates; you could use Carbon to generate the date values etc...

$clientemails = Capsule::table('tblemails')->select('id','subject','date')->orderBy('date','desc')->limit(100)->get();

the above would give you the last 100 emails sent by the system.... won't include domain reminders (which never even occurred to me when writing the above panel, so i'll fix that one day).

that gives you an array, then it's just a case of looping through it to output it...

Link to comment
Share on other sites

  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated