Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
3cba578
Simple nil check.
darrencauthon May 15, 2016
0209a9f
Refactor.
darrencauthon May 15, 2016
87053a7
Minor cleanup.
darrencauthon May 15, 2016
f021578
Remove the empty test class.
darrencauthon May 15, 2016
7d01cde
Merge pull request #71 from SparkPost/inbound_domains
darrencauthon May 15, 2016
b43a759
Get this method under some tests.
darrencauthon May 15, 2016
1449363
Use the ToDictionary method to avoid the exception to the convention …
darrencauthon May 15, 2016
bf7c6aa
Refactor.
darrencauthon May 15, 2016
8def1ba
Refactor.
darrencauthon May 15, 2016
17852d1
Merge in the latest changes from master.
darrencauthon May 15, 2016
11c67cf
Merge pull request #73 from SparkPost/relay_webhooks_review
darrencauthon May 15, 2016
53ac3b0
Make these nuspec values explicit.
darrencauthon May 15, 2016
3241df5
Merge pull request #74 from SparkPost/nuspec
darrencauthon May 15, 2016
20e4fdc
One more explicit note.
darrencauthon May 15, 2016
4af65f9
Create templates folder. Test that LF line-endings remain.
jamesoflol Apr 22, 2016
ab2c50b
Initial add of templates dir files
jamesoflol Apr 22, 2016
a74a5fe
Add line to .gitattributes
jamesoflol Apr 22, 2016
b05ea4f
Include Create template call in Client.cs and DataMapper.cs
jamesoflol Apr 22, 2016
77d4268
Newline at EOF: TemplateContent.cs
jamesoflol Apr 22, 2016
c451874
Added Retrieve template function
jamesoflol May 13, 2016
e71caf8
Fix templates request URL parameter
jamesoflol May 16, 2016
7fa5b4a
Fix merge of new changes.
jamesoflol May 16, 2016
a72f249
Move everything out of Templates folder - it's not matching current c…
jamesoflol May 16, 2016
64595c4
Bump the version.
darrencauthon May 16, 2016
881eaec
Add the working Dockerfile and build & deploy script.
darrencauthon May 18, 2016
b101004
Add a blank readme.
darrencauthon May 18, 2016
cdb77a1
Update readme.md
darrencauthon May 18, 2016
515103d
Merge pull request #75 from SparkPost/nuget
darrencauthon May 18, 2016
60f562a
Specify the file to include in the package.
darrencauthon May 19, 2016
261f90f
Fix the file reference.
darrencauthon May 19, 2016
69e3455
Include the XML, too.
darrencauthon May 19, 2016
2627626
Cannot start with a slash when running through a bash script.
darrencauthon May 19, 2016
fc2de06
Must update nuget, as mono comes with an old version.
darrencauthon May 19, 2016
414d0e1
Merge pull request #77 from SparkPost/manually_select_files
darrencauthon May 19, 2016
4b1dbf7
Bump the version.
darrencauthon May 19, 2016
36072bd
Nuget with mono seems to hang while restoring packages. This solution…
darrencauthon May 19, 2016
f60d1b0
Have to specify the source with the latest nuget.
darrencauthon May 19, 2016
ad59b6b
Merge pull request #78 from SparkPost/more_mono_nuget_fixes
darrencauthon May 19, 2016
dd42dc7
Bump the version, this version seems clean of any Mono issues.
darrencauthon May 19, 2016
b0c3d1e
Merge branch 'master' of github.com:SparkPost/csharp-sparkpost into c…
darrencauthon May 26, 2016
63f2d2a
Shift these new bits to use the consolidated json work.
darrencauthon May 26, 2016
2467fd2
Merge pull request #66 from SparkPost/consolidate_the_json_encoding
darrencauthon May 26, 2016
e4cea6d
add the operation of RecipientList API
FrankZhangWiesWolf May 26, 2016
54c0831
Merge pull request #80 from FrankZhangWiesWolf/AddRecipientListsOpera…
darrencauthon May 26, 2016
56ffbf0
Added basic examples projects
ewandennis May 27, 2016
c39452f
Merge pull request #82 from ewandennis/examples
darrencauthon May 27, 2016
924b0f2
Put the files back.
darrencauthon May 30, 2016
fe4e5dd
Try zipping the nupkg myself.
darrencauthon May 31, 2016
6cea163
This method is missing from the interface.
darrencauthon May 31, 2016
718b7f1
Merge pull request #84 from SparkPost/missing_method_on_interface
darrencauthon May 31, 2016
75a0bf0
If a subaccount is passed in the constructor, SET IT.
darrencauthon May 31, 2016
268e5c0
Merge pull request #85 from SparkPost/set_the_subaccount_id
darrencauthon May 31, 2016
1f648ed
Cut out the debugging.
darrencauthon May 31, 2016
d6661b3
Explain the funny business.
darrencauthon May 31, 2016
ec81dbe
Merge pull request #83 from SparkPost/figure_this_docker_issue_out
darrencauthon May 31, 2016
c0cb1ae
Bump the version.
darrencauthon May 31, 2016
ec4283b
Cleanup.
darrencauthon May 31, 2016
db7d1e2
I think this method creates recipient lists, it does not send them.
darrencauthon May 31, 2016
5681744
Spacing.
darrencauthon May 31, 2016
0a096bc
Update the XML docs.
darrencauthon May 31, 2016
5fc473e
Update the docs here, too.
darrencauthon May 31, 2016
f11288b
Merge pull request #86 from SparkPost/cleanup_recipient_lists
darrencauthon May 31, 2016
e1049da
This includes partial support, not full support yet.
darrencauthon May 31, 2016
1ea9723
Bring in the latest master.
darrencauthon May 31, 2016
92f85da
Merge pull request #87 from SparkPost/jamesoflol-templates-support-2
darrencauthon May 31, 2016
e08c866
Bump the version.
darrencauthon Jun 2, 2016
a3ccb6f
Spaces not tabs. Not meaning to start a debate - just making this con…
darrencauthon Jun 3, 2016
c724171
Extract a variable, spacing.
darrencauthon Jun 3, 2016
58fb6fb
Replace the Wait() with a switch to make the library work in sync mode.
darrencauthon Jun 3, 2016
2eba27d
Make it clear to others that a response is returned.
darrencauthon Jun 3, 2016
05ea8ce
Merge pull request #88 from SparkPost/example_cleanup
darrencauthon Jun 3, 2016
ff8c742
Merge pull request #89 from SparkPost/make_sync_explicit
darrencauthon Jun 3, 2016
37b51c6
Changes for moving library to community support (#90)
aydrian Jun 3, 2016
492080c
add the templates retrieve method
FrankZhangWiesWolf Jun 20, 2016
a2c8307
add the response files
FrankZhangWiesWolf Jun 20, 2016
895a2c7
fix the typo and renmae some functions
FrankZhangWiesWolf Jun 21, 2016
78d19c6
Update Travis badge.
darrencauthon Jun 21, 2016
f756c1d
This is my repo now, let travis know.
darrencauthon Jun 21, 2016
3dcce5a
Merge branch 'AddRetrieveTemplatesMethod' of https://github.com/Frank…
darrencauthon Jun 21, 2016
ea88b9a
I don't think headers applies to the list of templates.
darrencauthon Jun 21, 2016
249f5cc
Methods like these are usually called List.
darrencauthon Jun 21, 2016
2d1288c
Our template list contains less data than a detail. Use inheritance t…
darrencauthon Jun 21, 2016
90c6f33
Cleanup.
darrencauthon Jun 21, 2016
af06864
More cleanup.
darrencauthon Jun 21, 2016
7a8930b
Merge pull request #95 from darrencauthon/FrankZhangWiesWolf-AddRetri…
darrencauthon Jun 22, 2016
2fd3b14
Bump the version.
darrencauthon Jun 22, 2016
a6a835a
add the template to IClient
FrankZhangWiesWolf Jun 27, 2016
14562df
Merge pull request #96 from FrankZhangWiesWolf/addTheTemplateToIClient
darrencauthon Jun 27, 2016
5c651d4
Bump the version.
darrencauthon Jun 27, 2016
cb11c69
add some fields which need for response
FrankZhangWiesWolf Jun 29, 2016
085576c
Merge pull request #97 from FrankZhangWiesWolf/addTheTemplateToIClient
darrencauthon Jun 29, 2016
7e973e2
Bump the version.
darrencauthon Jun 29, 2016
fca8f75
Init managing sending domains
zeuss2011 Jun 30, 2016
5cbcad0
Fix SendingDomains.VerifyByDomain
zeuss2011 Jun 30, 2016
7ac05d1
Add SendingDomainTests
zeuss2011 Jun 30, 2016
b22edb5
Delete all references to JsonPropertyAttribute and EnumMemberAttribute
zeuss2011 Jul 1, 2016
0bfe2b2
Merge branch 'manage_sending_domains' of https://github.com/zeuss2011…
darrencauthon Jul 2, 2016
cb8a22a
Get tests on the status.
darrencauthon Jul 2, 2016
e5e447a
Test the dkim.
darrencauthon Jul 2, 2016
8b26ec4
Remove the need to manually set these properties in the dictionary.
darrencauthon Jul 2, 2016
8ac3e56
Cleanup.
darrencauthon Jul 2, 2016
45985a3
Drop the console.
darrencauthon Jul 2, 2016
992b28a
I respect the idea of using the constants, but it's extra code.
darrencauthon Jul 3, 2016
048d2ff
Rename to match other bits of the library.
darrencauthon Jul 3, 2016
c1fbc10
An update probably goes through PUT, not DELETE.
darrencauthon Jul 3, 2016
3ffb8ae
Refactor.
darrencauthon Jul 3, 2016
f4ff30c
R# cleanup.
darrencauthon Jul 3, 2016
8cbdabe
R# cleanup.
darrencauthon Jul 3, 2016
93aa9b6
Cleanup.
darrencauthon Jul 3, 2016
9d523c6
Refactor.
darrencauthon Jul 3, 2016
709b519
Drop the empty test file.
darrencauthon Jul 3, 2016
e33b51a
Merge pull request #99 from darrencauthon/zeuss2011-manage_sending_do…
darrencauthon Jul 3, 2016
d3d68e0
No need to name the delete method, just call it delete.
darrencauthon Jul 10, 2016
c13d248
Bump the version.
darrencauthon Jul 10, 2016
f242e2d
Adding delete to templates
Jetski5822 Jul 22, 2016
8713edd
Merge pull request #100 from Jetski5822/addingdeletetotemplates
darrencauthon Jul 22, 2016
129ed3f
Bump the version.
darrencauthon Jul 22, 2016
e9a0486
Start the specflow project.
darrencauthon Oct 3, 2016
7ad0594
Produce the first failing acceptance test.
darrencauthon Oct 3, 2016
d4d54fc
Found the point the code is now failing.
darrencauthon Oct 4, 2016
b6ad2f9
Refactor.
darrencauthon Oct 4, 2016
0838e09
Merge pull request #107 from darrencauthon/fix_recipient_retrieve_issue
darrencauthon Oct 4, 2016
2f96ade
Bump the version.
darrencauthon Oct 4, 2016
66afced
Create a spec for a recipient list creation, as well as delete method…
darrencauthon Oct 5, 2016
df62376
Make this spec more self-reliant.
darrencauthon Oct 5, 2016
3cd53e1
Test the recipients that are retrieved.
darrencauthon Oct 5, 2016
71c614f
Better specs.
darrencauthon Oct 5, 2016
14ea635
Spec refactoring.
darrencauthon Oct 5, 2016
cc2e043
Write a test for sending an email.
darrencauthon Oct 5, 2016
cb0cd43
Inject the scenario context instead of accessing it as a static prope…
darrencauthon Oct 6, 2016
9690262
Build an actual recipient list object when retrieving a recipient list.
darrencauthon Oct 11, 2016
954669b
Uncomplicate the tests by changing them to work against a recipient l…
darrencauthon Oct 11, 2016
9834617
Add a working recipient list update method.
darrencauthon Oct 11, 2016
3316d23
Since we are loading the recipient list object, there is no need to h…
darrencauthon Oct 21, 2016
957a583
Merge pull request #113 from darrencauthon/fix_retrieve_and_update_fo…
darrencauthon Oct 21, 2016
66a758b
Bump the version.
darrencauthon Oct 21, 2016
0aa1803
Add factory methods for File
Nov 23, 2016
006879a
Remove unnecessary qualifier
Nov 23, 2016
d01c7b4
Add ListDomains()
asherber Nov 27, 2016
31c46b0
Add other simple list methods
asherber Nov 27, 2016
2342d10
Refactor
asherber Nov 27, 2016
bc1c338
Make metrics lists return responses, add GetDeliverability()
asherber Nov 27, 2016
a9f680b
Factor out base deliverability functionality and add remaining methods
asherber Nov 27, 2016
636886d
Get values out of JValues
asherber Nov 28, 2016
d90cb29
Fall back to string keys for dictionaries; MetricsField is now just f…
asherber Nov 28, 2016
f358849
A little renaming
asherber Nov 28, 2016
06e663a
Add some unit tests
asherber Nov 29, 2016
78c7b94
Add Metrics to IClient
asherber Nov 30, 2016
74a389d
Add MetricsField.Allxxx
asherber Nov 30, 2016
565cebd
Add XML comments
asherber Nov 30, 2016
449a19b
Add tests that demonstrate and verify the new file helpers.
darrencauthon Dec 2, 2016
3513a5e
Merge pull request #120 from darrencauthon/file_helpers_with_integrat…
darrencauthon Dec 2, 2016
ae169af
Merge branch 'metrics' of https://github.com/asherber/csharp-sparkpos…
darrencauthon Dec 2, 2016
2826555
Drop the regions.
darrencauthon Dec 2, 2016
9cd1707
Add a feature file for metrics, with one working test.
darrencauthon Dec 2, 2016
789be7e
Slightly better specs.
darrencauthon Dec 2, 2016
75f454f
A better test name.
darrencauthon Dec 2, 2016
6ea4e69
Add a spec for bounce reasons.
darrencauthon Dec 2, 2016
f2aee1a
Merge pull request #121 from darrencauthon/metrics_with_specs
darrencauthon Dec 2, 2016
2e3abdb
Bump the version.
darrencauthon Dec 2, 2016
00b321c
Alternate constructors for Address
asherber Dec 7, 2016
04c9e6b
Add Transmssion.Parse()
asherber Dec 7, 2016
09567cf
Add unit tests and fix errors
asherber Dec 7, 2016
30b6daa
Merge branch 'mailmessage' of https://github.com/asherber/csharp-spar…
darrencauthon Dec 8, 2016
683de60
No need for abbreviation.
darrencauthon Dec 8, 2016
1e97ced
Spacing.
darrencauthon Dec 8, 2016
9cc3a56
Spacing.
darrencauthon Dec 8, 2016
626e981
This is how I'd normally format these tests.
darrencauthon Dec 8, 2016
7db614c
Style.
darrencauthon Dec 8, 2016
03a3f9e
Style, remove abbreviations.
darrencauthon Dec 8, 2016
3f008a2
Style.
darrencauthon Dec 8, 2016
c08bc2f
Extract a method.
darrencauthon Dec 8, 2016
2b3b1cb
Refactor.
darrencauthon Dec 8, 2016
9f0051a
Refactor.
darrencauthon Dec 8, 2016
52d4fcd
Dry it up.
darrencauthon Dec 8, 2016
29e49c9
This does not really parse the message, it loads it. And only privately.
darrencauthon Dec 8, 2016
64ad2e1
Refactor, start building a list of actions to take to convert a mailm…
darrencauthon Dec 8, 2016
1e52d9b
Refactor this logic into an isolated set for alternative text and html.
darrencauthon Dec 8, 2016
9aed1ff
Move these into actions as well.
darrencauthon Dec 8, 2016
fc1d1ca
Move all of this logic out of the POCO and into a separate class.
darrencauthon Dec 8, 2016
bdccdae
No need for this extracted method now.
darrencauthon Dec 8, 2016
5a11279
Resharper cleanup.
darrencauthon Dec 8, 2016
fa4531f
Resharper cleanup.
darrencauthon Dec 8, 2016
451afd1
Merge pull request #124 from darrencauthon/mailmessage_parsing_with_c…
darrencauthon Dec 8, 2016
ff9f619
Bring back the LoadFrom method.
darrencauthon Dec 8, 2016
6a90e3f
Merge pull request #125 from darrencauthon/bring_back_load_from
darrencauthon Dec 8, 2016
6643f45
If a transmission is to be built from a mail message, use a static he…
darrencauthon Dec 8, 2016
4b284df
Refactor.
darrencauthon Dec 8, 2016
b520a67
Merge pull request #126 from darrencauthon/use_a_static_helper_instea…
darrencauthon Dec 8, 2016
3bd5724
Bump the version.
darrencauthon Dec 8, 2016
fdf5c55
Put an integration test through suppressions, and resolve a change in…
darrencauthon Dec 9, 2016
5255c74
Use a random email address when testing with a 30 second sleep, which…
darrencauthon Dec 9, 2016
f87288f
Merge pull request #127 from darrencauthon/suppressions_null_issue
darrencauthon Dec 9, 2016
35242d2
Bump the version.
darrencauthon Dec 9, 2016
d9c8264
Stub out how the samples api will work.
darrencauthon Dec 16, 2016
e17aafc
Add the ability to get a message event sample from the API.
darrencauthon Dec 16, 2016
038c3f4
Merge pull request #131 from darrencauthon/samples_support
darrencauthon Dec 16, 2016
94e1bea
Bump the version.
darrencauthon Dec 16, 2016
24bf2f7
Extend Cc handling and fix failing tests
asherber Jan 21, 2017
6aa75be
Add new tests
asherber Jan 21, 2017
c4d8d8e
Fix typo 'MessageEvent.MessageForm'
asherber Jan 22, 2017
56e8894
Merge pull request #135 from asherber/fix_typo
darrencauthon Jan 23, 2017
b187772
Bump the version.
darrencauthon Jan 23, 2017
365a187
Fall back to old cc handling if we don't have exactly one To recipient
asherber Jan 23, 2017
5b1c1a3
Merge pull request #134 from asherber/cc_handling
darrencauthon Jan 24, 2017
1942f71
Add a test for CC/BCC behavior.
darrencauthon Jan 25, 2017
34fc37a
Create separate scenarios for multiple recipients and single recipients.
darrencauthon Jan 25, 2017
f3dad1c
Clear the deleted key.
darrencauthon Jan 25, 2017
e5d9f60
Merge pull request #137 from darrencauthon/add_tests_for_cc
darrencauthon Jan 25, 2017
7cfc174
Bump the version.
darrencauthon Jan 25, 2017
b6ba1c0
Refactor for case where Email is whitespace
asherber Feb 15, 2017
123ba77
Add tests to cover new white spacing handling.
darrencauthon Feb 16, 2017
9cf0763
Resharper suggested refactors.
darrencauthon Feb 16, 2017
fb69af7
Only do the trim once.
darrencauthon Feb 16, 2017
1e9d5b7
Merge pull request #141 from darrencauthon/asherber-fix-reply-to-test
darrencauthon Feb 16, 2017
3a8cb1e
Bump the version.
darrencauthon Feb 17, 2017
06ff714
Make the email with an attachment easier to spot.
darrencauthon Jun 26, 2017
e4630b2
Add a test case for the template email send with an attachment, which…
darrencauthon Jun 26, 2017
96ccbef
Better describe this scenario.
darrencauthon Jun 29, 2017
79efae1
Regenerate the specflow acceptance tests.
darrencauthon Jun 29, 2017
948c733
Merge pull request #147 from darrencauthon/cleanup
darrencauthon Jun 29, 2017
993314a
I think this is how a user agent would be set.
darrencauthon Jun 29, 2017
de550e5
Only set the user agent if it has been defined.
darrencauthon Jun 29, 2017
0b60c10
Refactor.
darrencauthon Jun 29, 2017
bf5000f
The default user agent should look like this.
darrencauthon Jun 29, 2017
36f7072
Just to double-check that it can be overwritten.
darrencauthon Jun 29, 2017
e2873c7
Throw in some crazy logic to get the current version.
darrencauthon Jun 29, 2017
05a94d1
Refactor.
darrencauthon Jun 29, 2017
ad808a3
Refactor.
darrencauthon Jun 29, 2017
6a14dc8
Refactor.
darrencauthon Jun 29, 2017
e724e3c
I do not want this to blow up on any users of this library.
darrencauthon Jun 29, 2017
6d0bddd
Refactor a bit more.
darrencauthon Jun 29, 2017
c24887b
Only set the user agent if a current version can be set.
darrencauthon Jun 29, 2017
f098f33
Merge pull request #149 from darrencauthon/useragent
darrencauthon Jul 2, 2017
047a691
Bump the version.
darrencauthon Jul 2, 2017
f4ad3c6
Bump the version here, too.
darrencauthon Jul 2, 2017
2b6581e
Added the TargetLinkUrl to MessageEvents
zythra Oct 11, 2017
4f191d3
We do not want to alter the metadata keys.
darrencauthon Nov 15, 2017
5aa75f2
Refactor.
darrencauthon Nov 15, 2017
f2694d8
Rename.
darrencauthon Nov 16, 2017
dcfca35
Merge pull request #154 from darrencauthon/do_not_alter_metadata_keys
darrencauthon Nov 16, 2017
a47d434
Adding docs for a custom hostname
avigoldman Mar 27, 2018
8eda80a
Merge branch 'Issue-152-AddTargetLinkUrl' of git://github.com/zythra/…
darrencauthon Jun 5, 2018
90c9034
Fix the spacing.
darrencauthon Jun 5, 2018
8f9e788
Drop the invalid xml comment.
darrencauthon Jun 5, 2018
be043de
Fix more spacing.
darrencauthon Jun 5, 2018
cca9242
Merge pull request #162 from darrencauthon/zythra-Issue-152-AddTarget…
darrencauthon Jun 5, 2018
7e52f36
Merge pull request #156 from avigoldman/patch-1
darrencauthon Jun 5, 2018
a907c8c
Bump the version.
darrencauthon Jun 5, 2018
792d5f8
Merge branch 'master' of github.com:darrencauthon/csharp-sparkpost
darrencauthon Jun 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Declare files that will always have CRLF line endings on checkout.
* text eol=lf
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ before_script:
- nuget restore src/SparkPost.sln
script:
- xbuild /p:Configuration=Release src/SparkPost.sln
- nunit-console /home/travis/build/SparkPost/csharp-sparkpost/src/SparkPost.Tests/bin/Release/SparkPost.Tests.dll
- nunit-console /home/travis/build/darrencauthon/csharp-sparkpost/src/SparkPost.Tests/bin/Release/SparkPost.Tests.dll
9 changes: 3 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Contributing to csharp-sparkpost

Transparency is one of our core values, and we encourage developers to contribute and become part of the SparkPost developer community.

The following is a set of guidelines for contributing to csharp-sparkpost,
which is hosted in the [SparkPost Organization](https://github.com/sparkpost) on GitHub.
which is hosted by [Darren Cauthon](https://github.com/darrencauthon) on GitHub.
These are just guidelines, not rules, use your best judgment and feel free to
propose changes to this document in a pull request.

## Submitting Issues

* Before logging an issue, please [search existing issues](https://github.com/SparkPost/csharp-sparkpost/issues?q=is%3Aissue+is%3Aopen) first.
* Before logging an issue, please [search existing issues](https://github.com/darrencauthon/csharp-sparkpost/issues?q=is%3Aissue+is%3Aopen) first.

* You can create an issue [here](https://github.com/SparkPost/csharp-sparkpost/issues/new). Please include the library version number and as much detail as possible in your report.
* You can create an issue [here](https://github.com/darrencauthon/csharp-sparkpost/issues/new). Please include the library version number and as much detail as possible in your report.

## Local Development

Expand All @@ -34,4 +32,3 @@ To contribute to csharp-sparkpost:
### Releasing

TODO: add instructions for publishing to https://www.nuget.org/

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<a href="https://www.sparkpost.com"><img src="https://www.sparkpost.com/sites/default/files/attachments/SparkPost_Logo_2-Color_Gray-Orange_RGB.svg" width="200px"/></a>
# C# Library for [SparkPost](https://www.sparkpost.com)

[Sign up](https://app.sparkpost.com/sign-up?src=Dev-Website&sfdcid=70160000000pqBb) for a SparkPost account and visit our [Developer Hub](https://developers.sparkpost.com) for even more content.
[![Travis CI](https://travis-ci.org/darrencauthon/csharp-sparkpost.svg?branch=master)](https://travis-ci.org/darrencauthon/csharp-sparkpost)

# SparkPost C# Library

[![Travis CI](https://travis-ci.org/SparkPost/ruby-sparkpost.svg?branch=master)](https://travis-ci.org/SparkPost/csharp-sparkpost) [![Slack Status](http://slack.sparkpost.com/badge.svg)](http://slack.sparkpost.com)

The official C# package for the [SparkPost API](https://www.sparkpost.com/api). Xamarin.iOS and Xamarin.Android support provided in the Portable Package (PCL Profile7).
A C# package for the [SparkPost API](https://developers.sparkpost.com/api). Xamarin.iOS and Xamarin.Android support provided in the Portable Package (PCL Profile7).

## Installation

Expand Down Expand Up @@ -107,7 +103,7 @@ The suppression list are users who have opted-out of your emails. To retrieve t
```c#
var client = new Client("MY_API_KEY");

client.Suppressions.List(); // returns a list of
client.Suppressions.List(); // returns a list of

client.Suppressions.List(new { limit = 3 }); // it accepts an anonymous type for filters

Expand Down Expand Up @@ -141,6 +137,10 @@ var client = new Client("MY_API_KEY");
client.Suppressions.Retrieve("testing@testing.com");
```

### Setting the API hostname
```c#
var client = new Client("MY_API_KEY", "https://api.eu.sparkpost.com");
```

### Contribute

Expand Down
21 changes: 21 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM mono
MAINTAINER Darren Cauthon <darren@cauthon.com>

RUN apt-get update
RUN apt-get install -y wget git dos2unix vim zip

RUN nuget update -self

ENV MONO_THREADS_PER_CPU 2000

WORKDIR /

RUN git clone https://github.com/SparkPost/csharp-sparkpost.git

WORKDIR /csharp-sparkpost/src

ADD build_and_deploy.sh /csharp-sparkpost/src
RUN chmod 777 build_and_deploy.sh
RUN dos2unix build_and_deploy.sh

CMD /csharp-sparkpost/src/build_and_deploy.sh
24 changes: 24 additions & 0 deletions docker/build_and_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
git pull origin master

nuget restore
xbuild /p:Configuration=Release

nuget pack SparkPost/SparkPost.nuspec -Prop Configuration=Release

PACKAGE=$(ls *.nupkg)

# This will unzip the nupkg, then zip it back up.
# This is done to some issue with the nuget command
# line app creating nupkg files that cannot be
# used by Visual Studio.
# https://github.com/NuGet/Home/issues/2833
mv $PACKAGE file.zip
mkdir stuff
cd stuff
unzip ../file.zip
rm ../file.zip
zip -r ../file.zip *
cd ..
mv file.zip $PACKAGE

nuget push $PACKAGE $APIKEY -s nuget.org
17 changes: 17 additions & 0 deletions docker/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Build & Deploy via Docker & Nuget

This docker container will pull the latest version of this library, create a nuget package, and deploy it to Nuget.

The only thing is needs is a valid Nuget API key, from someone that has rights to publish the package to Nuget.

```
cd docker
docker build . # this will produce a hash key, say 12345678
docker run -e "APIKEY=your_nuget_key_here" 12345678
```

This container has been registered on Docker Hub, and can be run like so:

```
docker run -e "APIKEY=your_nuget_key_here" darrencauthon/csharp-sparkpost
```
48 changes: 48 additions & 0 deletions examples/BCC/BCC.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{16978032-B34C-44B6-8DA1-475D751338F1}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>BCC</RootNamespace>
<AssemblyName>BCC</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SparkPost">
<HintPath>..\packages\SparkPost.1.6.2\lib\net45\SparkPost.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
60 changes: 60 additions & 0 deletions examples/BCC/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using System.Configuration;

namespace SparkPost.Examples
{
internal class BCC
{
public static void Main(string[] args)
{
var settings = ConfigurationManager.AppSettings;
var fromAddr = settings["fromaddr"];
var toAddr = settings["toaddr"];
var ccAddr = settings["ccaddr"];
var bccAddr = settings["bccaddr"];

var trans = new Transmission();

var to = new Recipient
{
Address = new Address {Email = toAddr}
};
trans.Recipients.Add(to);

var cc = new Recipient
{
Address = new Address
{
Email = ccAddr,
HeaderTo = toAddr
}
};
trans.Recipients.Add(cc);

var bcc = new Recipient
{
Address = new Address
{
Email = bccAddr,
HeaderTo = toAddr
}
};
trans.Recipients.Add(bcc);

trans.Content.From.Email = fromAddr;
trans.Content.Subject = "SparkPost BCC / CC example";
trans.Content.Text =
"This message was sent To 1 recipient, 1 recipient was CC'd and 1 sneaky recipient was BCC'd.";
trans.Content.Headers.Add("CC", ccAddr);

Console.Write("Sending BCC / CC sample mail...");

var client = new Client(settings["apikey"]);
client.CustomSettings.SendingMode = SendingModes.Sync;

var response = client.Transmissions.Send(trans);

Console.WriteLine("done");
}
}
}
27 changes: 27 additions & 0 deletions examples/BCC/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Reflection;
using System.Runtime.CompilerServices;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("BCC")]
[assembly: AssemblyDescription("SparkPost C# BCC Example")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

5 changes: 5 additions & 0 deletions examples/BCC/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="6.0.1" targetFramework="net45" />
<package id="SparkPost" version="1.6.2" targetFramework="net45" />
</packages>
51 changes: 51 additions & 0 deletions examples/CC/CC.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2B086611-A56B-4857-9F7F-A8603D7AA3FD}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>CC</RootNamespace>
<AssemblyName>CC</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SparkPost">
<HintPath>..\packages\SparkPost.1.6.2\lib\net45\SparkPost.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<None Include="..\app.config">
<Link>app.config</Link>
</None>
<None Include="packages.config" />
</ItemGroup>
</Project>
48 changes: 48 additions & 0 deletions examples/CC/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using System.Configuration;

namespace SparkPost.Examples
{
internal class CC
{
public static void Main(string[] args)
{
var settings = ConfigurationManager.AppSettings;
var fromAddr = settings["fromaddr"];
var toAddr = settings["toaddr"];
var ccAddr = settings["ccaddr"];

var trans = new Transmission();

var to = new Recipient
{
Address = new Address {Email = toAddr}
};
trans.Recipients.Add(to);

var cc = new Recipient
{
Address = new Address
{
Email = ccAddr,
HeaderTo = toAddr
}
};
trans.Recipients.Add(cc);

trans.Content.From.Email = fromAddr;
trans.Content.Subject = "SparkPost CC example";
trans.Content.Text = "This message was sent To 1 recipient and 1 recipient was CC'd.";
trans.Content.Headers.Add("CC", ccAddr);

Console.Write("Sending CC sample mail...");

var client = new Client(settings["apikey"]);
client.CustomSettings.SendingMode = SendingModes.Sync;

var response = client.Transmissions.Send(trans);

Console.WriteLine("done");
}
}
}
Loading