Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
d8c20bdb
Commit
d8c20bdb
authored
5 years ago
by
DaveD
Browse files
Options
Downloads
Patches
Plain Diff
fix E_NOTICE
parent
7e51746c
Branches
dependabot/composer/phpoffice/phpspreadsheet-1.29.9
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/v3/Mailing.php
+1
-1
1 addition, 1 deletion
api/v3/Mailing.php
tests/phpunit/CRM/SMS/PreviewTest.php
+59
-0
59 additions, 0 deletions
tests/phpunit/CRM/SMS/PreviewTest.php
with
60 additions
and
1 deletion
api/v3/Mailing.php
+
1
−
1
View file @
d8c20bdb
...
...
@@ -594,7 +594,7 @@ function civicrm_api3_mailing_preview($params) {
return
civicrm_api3_create_success
([
'id'
=>
$mailingID
,
'contact_id'
=>
$contactID
,
'subject'
=>
$mime
->
headers
()
[
'Subject'
]
,
'subject'
=>
CRM_Utils_Array
::
value
(
'Subject'
,
$mime
->
headers
()
,
''
)
,
'body_html'
=>
$mime
->
getHTMLBody
(),
'body_text'
=>
$mime
->
getTXTBody
(),
]);
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/CRM/SMS/PreviewTest.php
0 → 100644
+
59
−
0
View file @
d8c20bdb
<?php
/**
* Test SMS Preview
*
* @group headless
*/
class
CRM_SMS_PreviewTest
extends
CiviUnitTestCase
{
/**
* Set Up Function
*/
public
function
setUp
()
{
parent
::
setUp
();
$option
=
$this
->
callAPISuccess
(
'option_value'
,
'create'
,
[
'option_group_id'
=>
'sms_provider_name'
,
'name'
=>
'test_provider_name'
,
'label'
=>
'Test Provider Label'
,
'value'
=>
1
]);
$this
->
option_value
=
$option
[
'id'
];
}
/**
* Clean up after each test.
*/
public
function
tearDown
()
{
parent
::
tearDown
();
$this
->
callAPISuccess
(
'option_value'
,
'delete'
,
[
'id'
=>
$this
->
option_value
]);
}
/**
* Test SMS preview.
*/
public
function
testSMSPreview
()
{
$result
=
$this
->
callAPISuccess
(
'SmsProvider'
,
'create'
,
[
'title'
=>
'test SMS provider'
,
'username'
=>
'test'
,
'password'
=>
'password'
,
// 'name' is the option_value 'value' (not id, not name) we created in setUp()
'name'
=>
1
,
'is_active'
=>
1
,
'is_default'
=>
1
,
'api_type'
=>
1
,
]);
$provider_id
=
$result
[
'id'
];
$result
=
$this
->
callAPISuccess
(
'Mailing'
,
'create'
,
[
'name'
=>
"Test1"
,
'from_name'
=>
"+12223334444"
,
'from_email'
=>
"test@test.com"
,
'replyto_email'
=>
"test@test.com"
,
'body_text'
=>
"Testing body"
,
'sms_provider_id'
=>
$provider_id
,
'header_id'
=>
NULL
,
'footer_id'
=>
NULL
,
'unsubscribe_id'
=>
NULL
,
]);
$mailing_id
=
$result
[
'id'
];
$result
=
$this
->
callAPISuccess
(
'Mailing'
,
'preview'
,
[
'id'
=>
$mailing_id
,
]);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment