Server error log
Stack trace
- XF\PrintableException: Job Truonglv\Sendy\Job\EmailBounce: An error occurred while subscribe newsletters. Please try again later.
- src/addons/Truonglv/Sendy/Api/Sendy.php:161
- Generated by: Unknown account
- Apr 16, 2019 at 3:20 PM
#0 src/addons/Truonglv/Sendy/Api/Sendy.php(91): Truonglv\Sendy\Api\Sendy->post('https://www.dom...', Array)
#1 src/addons/Truonglv/Sendy/Service/Subscription.php(46): Truonglv\Sendy\Api\Sendy->getStatus('1merman187@g...', '0W8Dy763bK7M9HW...')
#2 src/addons/Truonglv/Sendy/Job/EmailBounce.php(59): Truonglv\Sendy\Service\Subscription->checkEmailBouncing()
#3 src/XF/Job/Manager.php(253): Truonglv\Sendy\Job\EmailBounce->run(G)
#4 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#5 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#6 job.php(42): XF\Job\Manager->runQueue(false, 8)
#7 {main}
The current tester feedback very very slow. Can you help it?
Sync
job fetches chunks of 10 unprocessed records from xf_sendy_user
(synced_date = 0
) and syncs the subscription to Sendy if all prerequisites are met. After a successful sync, the synced_date
is set to the current timestamp.user_state
not equal to valid
it's not synced (see Service\Subscription::onRegistered()
and Service\Subscription::onEmailChanged()
), but fetched on the next run again as synced_date
is 0. That leads to an infinite loop, as there are unsynced records found each time the job runs.xf_sendy_users
when the XenForo user account has the user_state = 'valid'
, see the attached diff.--- a/Job/Sync.php
+++ b/Job/Sync.php
@@ -32,6 +32,7 @@ class Sync extends AbstractJob
$finder = $this->app->finder('Truonglv\Sendy:User');
$finder->with('User');
+ $finder->where('User.user_state', 'valid');
$finder->where('synced_date', 0);
$finder->order('queue_date', 'asc');
Are you used version 3.0.x?Hi @truonglv
we've had problems with syncing subscriptions from XenForo to Sendy and built a quick fix.
TheSync
job fetches chunks of 10 unprocessed records fromxf_sendy_user
(synced_date = 0
) and syncs the subscription to Sendy if all prerequisites are met. After a successful sync, thesynced_date
is set to the current timestamp.
When a user record has auser_state
not equal tovalid
it's not synced (seeService\Subscription::onRegistered()
andService\Subscription::onEmailChanged()
), but fetched on the next run again assynced_date
is 0. That leads to an infinite loop, as there are unsynced records found each time the job runs.
Our quick-fix loads only records fromxf_sendy_users
when the XenForo user account has theuser_state = 'valid'
, see the attached diff.
I don't know if that's the best solution but at least it works in our case.
Code:--- a/Job/Sync.php +++ b/Job/Sync.php @@ -32,6 +32,7 @@ class Sync extends AbstractJob $finder = $this->app->finder('Truonglv\Sendy:User'); $finder->with('User'); + $finder->where('User.user_state', 'valid'); $finder->where('synced_date', 0); $finder->order('queue_date', 'asc');
Are you used version 3.0.x?
Any updates on this?Hello everyone. This add-on under rewriting. Will have new version in 1-2 weeks. Thank you.
Hello everyone. This add-on under rewriting. Will have new version in 1-2 weeks. Thank you.
Notable changes:
- Rewrite this add-ons
truonglv updated [tl] Sendy Integration with a new update entry:
3.0.2
Read the rest of this update entry...
Have not tested with Sendy 3 but i think it's should work.What changed? Does it work with sendy 3?
Have not tested with Sendy 3 but i think it's should work.
This add-on just rewrite and the flow to management subscriptions still same.
We use essential cookies to make this site work, and optional cookies to enhance your experience.