M2.4.7, v1.1.2: It sends current date even no expiry set for the gift card

Created by Esther Nguyen, Modified on Sun, 19 Apr at 11:02 PM by Support Agent

ISSUE:


Your gift card extension have a bug in email templates. It sends current date even no expiry set for the gift card.


bss_giftcard_pattern_code > expiry_day column is set as NULL because we don't set expiry for the Gift card code. But in email, it passes the current date even though it's null


This seems invalid (unconditional) expires email value passed without checking expiry date is empty or not and hence it's passing current date


public function autoSendMail($code)

'expires' => $this->localeDate->formatDate(

$code->getExpiryDay(),

\IntlDateFormatter::MEDIUM

),


 You can see the email send date and expiry is same even though No expiry set for that code.


SOLUTION:


To resolve the issue, please edit the file app/code/Bss/Bss/GiftCard/Model/Email.php as below: 



If you need any further assistance, please feel free to contact us. We'd be happy to support you!


Explore more powerful extensions:


I hope that the info is helpful. Could you please check our sites also to see which extension meets your needs?
If you have any further queries, please feel free to contact us at sales@bsscommerce.com or create a ticket. We'd like to help you.


To get to know us, here are some information:


BSS Commerce is a full-service ecommerce agency with 14+ years of experience, supporting 75,000+ customers worldwide. As an Adobe Commerce Solution Bronze Partner and Select Magento Extensions Builder, we deliver trusted end-to-end solutions.


Our core strength is Magento, with 150+ extensions designed to enhance store performance and drive growth. With deep expertise from years of working on Magento websites, we deliver scalable, high-impact solutions backed by strong client trust.


Discover our extensions: https://bsscommerce.com/magento-2-extensions.html

 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article