Skip to content

Commit 494f473

Browse files
feat(api): Validate mx record for inbound parse functionality
1 parent 79c6a0b commit 494f473

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

src/Actions/ManagesInboundParse.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Novu\SDK\Actions;
4+
5+
use Novu\SDK\Resources\InboundParse;
6+
7+
trait ManagesInboundParse
8+
{
9+
10+
/**
11+
* Validate the MX Record setup for Inbound Parse functionality
12+
*
13+
* @return \Novu\SDK\Resources\InboundParse
14+
*/
15+
public function validateMXRecordForInboundParse()
16+
{
17+
$record = $this->get("inbound-parse/mx/status")['data'];
18+
19+
return new InboundParse($record, $this);
20+
}
21+
}

src/Novu.php

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class Novu
1212
Actions\ManagesTopics,
1313
Actions\ManagesSubscribers,
1414
Actions\ManagesActivity,
15+
Actions\ManagesInboundParse,
1516
Actions\ManagesChanges,
1617
Actions\ManagesEnvironments,
1718
Actions\ManagesExecutionDetails,

src/Resources/InboundParse.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Novu\SDK\Resources;
4+
5+
class InboundParse extends Resource
6+
{
7+
/**
8+
* The mxRecordConfigured status
9+
*
10+
* @var bool
11+
*/
12+
public $mxRecordConfigured;
13+
14+
/**
15+
* Return the array form of InboundParse object.
16+
*
17+
* @return array
18+
*/
19+
public function toArray(): array
20+
{
21+
return [
22+
'mxRecordConfigured' => $this->mxRecordConfigured
23+
];
24+
}
25+
}

0 commit comments

Comments
 (0)