berstein
Member-
Posts
25 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Hotfixes
Everything posted by berstein
-
Dear all, I would like to ask whether it is possible to create custom API not inside "includes/api" but inside my custom addon module? Creating API inside module will make grouping easier per functionality and simplify repository management. Thank you
-
Dear all, Is there any documentation provided by WHMCS regarding custom security module? I want to create custom OTP functionality for logging in, and I believe how to achieve it is by creating custom security module but I cant find any documentation online. I have checked that there are several providers sell modules for OTP, so I think it is possible to achieve it. Any suggestion are welcomed. Thank you
- 1 reply
-
1
-
Display Extra Service Detail in Client Area
berstein replied to berstein's topic in Developer Corner
I see, Kind of disappointed that there are no built-in function within WHMCS for this functionality. I think the workaround is just use the 'domain' field of the service, which normally used to show the domain name of a hosting service. Thank you for your answer -
You can edit the invoice template on whmcs\templates\[your template]\invoicepdf.tpl Check which template you are currently using. WHMCS default template includes Six and Twenty-One if I'm not mistaken. Must be one of those if you didn't change the template before. I hope that helps
-
Hello, I was wondering how can I add extra information under the product's name in the Products & Services list in the Client Area like inside the WHMCS's dashboard? Is it using default WHMCS functionality or should I create customized template for that? Thank you
-
This might not what you are looking for, but setting the mail SMTP to Mailtrap can still log your email without actually sending to recipient. I haven't check whether cancelling the mail sending using hooks "EmailPreSend" would still log the mail delivery or not.
-
So, if the client purchase the product on 15th, they have to pay full price; and they have to pay full price again on the 1st day of month? I think yes, you shouldn't use WHMCS's prorata billing, so whenever the client order the product, they will get the full price. But you will need to modify the due date on the service, and you will also need to modify the product's period in the invoice description. My invoice item show the line like this: Product Name Placeholder (29/05/2023 - 31/05/2023) I don't know if it's configurable by WHMCS default, but you need to change it to before the first day of the next month, since it will follow the value of the NDD/NID (haven't check which one to be exact) of the service. Default prorata product probably will shows the 15th of this month and 15th of the next month (assuming client purchased it on the 15th)
-
Hello all, I was wondering if is there any way I can manually trigger a hook? I'm currently using custom module and also paid module (encrypted) and they kinda won't work together. What I need is to trigger the paid module's hook function (I assume it use UpdateInvoiceTotal hook) after my custom module done executing. My custom module use UpdateInvoice API, but it wont trigger the UpdateInvoiceTotal hook. Any advice is welcomed. Thank you
-
@ghsa Is the "Mail Provider" you are looking the same "Mail Provider" in the "Configure Mail Provider" window? If yes, I think the "module" is what you are looking for since the options for mail providers are equal with the mail modules inside WHMCS. Please correct me if I'm wrong or if I misunderstand the question.
-
I'm currently creating a module using guzzlehttp/guzzle and symfony/mailer package. The module works as intended, it grabs data from API and send email using symfony mailer by copying the SMTP credential from WHMCS configuration in database. But, after few times sending email, I'm starting to get ErrorException when opening pages in WHMCS (mostly those which URL ended with index.php). From the error stack, it says the error comes from Laminas\Diactoros package. I don't have any experience with that module and I don't know why it is used by WHMCS. Anyobody have a clue about Laminas\Diactoros package and what it does? Whoops\Exception\ErrorException: Declaration of Laminas\Diactoros\ServerRequest::withCookie Params(array $cookies): Laminas\Diactoros\ServerRequest must be compatible with Psr\Http\Message\ServerRequestInterface::withCookie Params(array $cookies)
-
Sir @Rahat_Arif The SMTP configuration is stored on "tblconfiguration" on column "setting" with the value of "MailConfig". Like sir @Kian said, you need to decrypt() the value of MailConfig. The decrypted value will return JSON containing SMTP setting. I'm currently using WHMCS 8.0. I hope this helps.
-
Sir @iKaros do you use internal WHMCS mail configuration to send the email (e.g. email send button or API) ? I have a question regarding email styling, where I want to use Symfony mailer package to send email (I have various requirements which are not supported by using sendmail API). The problem is, the WHMCS variable for company name and company logo won't loaded properly. Did you face similar issue or maybe do you have solution to this issue? Thanks
-
Error "Dataset must be an array" when opening Product/Services menu
berstein replied to berstein's topic in Developer Corner
-
Dear all, I'm having an issue in my WHMCS development environment. When I try to open the menu Clients > Product/Services > Other Services, it will show error "Dataset must be an array". I have tried opening the database and opening the tblhosting, it seems that deleting the 1st and 3rd of the last 150 records somehow fix the problem. I suspect there is some kind of relation issue, but when I tried to relate from tblhosting to tblorders and tblproducts on the last 50 rows, I see nothing wrong and no NULL found. Anyone have ever meet similar issue? I want to troubleshoot it on my dev environment before similar issue found on my production. Thank you (I'm unable to post full stack trace, the website returned 403 forbidden)
-
Dear all, Is it possible to generate invoice on the D-day of the Due Date? I have a product set with prorata billing using Prorata Date 1 and Charge Next Month 32. I want the invoice to be generated on the 1st of the month. I have tried setting the Invoice Generation to 0 day(s) before the due payment date, but it doesn't seems to work. Is there any way to achieve this? Thank you
-
Dear @Kian, thank you for your reply, Unfortunately, the data I'm collecting is pulled via SQL query, so I think hooks is out of the options. But, after some thought, we can use the hook to create flag of the invoice in the database by using custom table. The only downside is this will only works on invoice created after this hooks' activation. I have used this hook in the past, but if I'm not mistaken, the autogen source can't differentiate between recurring invoice and invoice created through new order. Please correct me if I'm wrong. Thank you
-
Dear all, For update, I change the logic where if all invoice item's relid is 0 and the type is "", then it counted as manual invoice. Then, if the invoice is not counted as new order or manual invoice, it counted as recurring invoice. Still, if you have better way to achieve this, please inform me. Thank you
-
Dear all, I would like to know how to detect (or some kind of flag) whether the invoice is created through new order, recurring, or manually created. For new order, I can search for the order that have the same invoice ID as the invoice. For recurring, temporary, I get all the relid of the invoice items and loop them in tblinvoiceitems. If any of the relid return more than 1, then the invoice is recurring. Is there any better way to achieve this? Thank you
-
Hooks for manually created and published invoice
berstein replied to berstein's topic in Developer Corner
Dear all, @pRieStaKos and @leemahoney3 I have finished creating the hooks for manually created invoice. All's good, no issues found 😄 Thank you for your assistance -
Hooks for manually created and published invoice
berstein replied to berstein's topic in Developer Corner
I facepalmed myself after reading your reply. Thank you pal, I will try the hook on monday. 😄 -
Dear all, I want to run a function after invoice is created (published) and I'm currently using InvoiceCreated hook. The hook works for invoices that are created after client issue an order via client area. But sadly, it doesn't work for invoices that are manually created and published. When I try to publish the drafted invoice, no hooks running. I have tried the InvoiceCreationPreEmail hook but it only run by clicking the "Publish and Send Mail" button, not the "Publish" button which I need. Is there any alternative for this issue? I'm using WHMCS version 8.1.3 Any suggestion are welcomed. Thank you
-
Dear all, I'm having an issue where I'm trying to pass long string to customvars in SendMail API. The string contains HTML table and I want to show it inside email template. I have successfully pass table with few rows, but WHMCS seems to be having difficulty when I pass table with 40 rows. The table not showing in the template. The error in the activity log shows: "Failed to unserialize input string. 20922 exceeds maximum of 16384". The question is: can I change the maximum limit or something? Thank you
-
Dear all, I'm currently building a hook and a module for invoice items grouping and automatic invoice splitting on invoice creation. I can group invoice items using tblinvoiceitems, but I haven't found a way to group a billable item. Is there any way to force a billable item to be included in specific invoice? While typing this topic, I had an idea where I use the values from tblbillableitem, add them to my grouping alongside the items from tblinvoiceitems, and modified the value on tblbillableitem when the invoices are generated so they are considered already sent. Please tell me if you have better idea to achieve this. Thank you
-
Dear all, I'm currently testing to create single sign on access token via Postman, but the redirect url given in the response still require me to login manually when I use it on incognito browser. What I understand about the CreateSsoToken API is the redirect_url returned on the response is supposed to bypass the login for the given client_id or user_id to the given destination. Please correct me if I get the wrong concept of the API. Thank you.
