Skip to content

Commit f5aaefd

Browse files
authored
Merge pull request #110 from lsthompson/master
(Admin Area) Button to Resend Transfer Approval Email
2 parents dee1268 + 5daeab9 commit f5aaefd

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

modules/registrars/synergywholesaledomains/synergywholesaledomains.php

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2481,15 +2481,30 @@ function synergywholesaledomains_validateAUState($state)
24812481

24822482
function synergywholesaledomains_AdminCustomButtonArray(array $params)
24832483
{
2484-
$buttons = [
2484+
$buttons = [
24852485
'Sync' => 'sync_adhoc',
24862486
'Push' => 'push',
24872487
];
24882488

2489+
// If the Domain is AU, then add CoR button to the Admin Area
24892490
if (Str::endsWith($params['tld'], 'au')) {
24902491
$buttons = array_merge($buttons, ['Initiate .au CoR' => 'initiateAuCor']);
24912492
}
24922493

2494+
// Add "Resend Approval Email" if domain status is "Pending Transfer"
2495+
try {
2496+
$domain = Capsule::table('tbldomains')
2497+
->where('id', $params['domainid'])
2498+
->first();
2499+
2500+
if ($domain && $domain->status === 'Pending Transfer') {
2501+
$buttons['Resend Approval Email'] = 'resendTransferApprovalEmail';
2502+
}
2503+
} catch (Exception $e) {
2504+
// Do not add the button if DB check fails, just log the failure
2505+
logModuleCall('synergywholesaledomains', 'AdminCustomButtonArray', 'DB Lookup Failed for Domain Status = Pending Transfer', $e->getMessage());
2506+
}
2507+
24932508
return $buttons;
24942509
}
24952510

@@ -2560,6 +2575,25 @@ function synergywholesaledomains_initiateAuCor(array $params)
25602575
}
25612576
}
25622577

2578+
function synergywholesaledomains_resendTransferApprovalEmail(array $params)
2579+
{
2580+
try {
2581+
synergywholesaledomains_apiRequest('resendTransferEmail', $params, [
2582+
'domainName' => synergywholesaledomains_helper_getDomain($params),
2583+
]);
2584+
} catch (\Exception $e) {
2585+
logModuleCall('synergywholesaledomains', 'resendTransferApprovalEmail', $params, $e->getMessage());
2586+
2587+
return [
2588+
'error' => 'Request Failed with error: ' . $e->getMessage(),
2589+
];
2590+
}
2591+
2592+
return [
2593+
'success' => 'Transfer Approval email resent successfully.',
2594+
];
2595+
}
2596+
25632597
function synergywholesaledomains_sync_adhoc(array $params)
25642598
{
25652599
try {

0 commit comments

Comments
 (0)