Skip to content

Commit

Permalink
fix tests in GH actions + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmh committed Dec 16, 2024
1 parent a389780 commit 2b24ed5
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 41 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,6 @@ on:
branches: [ master ]

jobs:
build_and_tests_on_dotnet_6:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore ./Src/All.sln
- name: Build
run: dotnet build ./Src/All.sln
- name: Mailer Tests
run: dotnet test ./Src/UnitTests/MailerUnitTests/MailerUnitTests.csproj
- name: Unit Tests
run: dotnet test ./Src/UnitTests/CoravelUnitTests/CoravelUnitTests.csproj
- name: Integration Tests
run: dotnet test ./Src/IntegrationTests/Tests/Tests.csproj
build_and_tests_on_dotnet_7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore ./Src/All.sln
- name: Build
run: dotnet build ./Src/All.sln
- name: Mailer Tests
run: dotnet test ./Src/UnitTests/MailerUnitTests/MailerUnitTests.csproj
- name: Unit Tests
run: dotnet test ./Src/UnitTests/CoravelUnitTests/CoravelUnitTests.csproj
- name: Integration Tests
run: dotnet test ./Src/IntegrationTests/Tests/Tests.csproj
build_and_tests_on_dotnet_8:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion Demo/Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<AddRazorSupportForMvc>True</AddRazorSupportForMvc>
</PropertyGroup>
Expand Down
30 changes: 30 additions & 0 deletions DocsV2/docs/Mailing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,36 @@ Sender("test@test.com")

Attach multiple files by passing an `Attachment` to the `Attach()` method.

Each attachment has a few fields to assign:

- `Bytes`: The `byte[]` of the file you are attaching.
- `Name`: The name of the file to attach.
- `ContentId`: Often used for embedding images into emails. Assign a value that is unique within your email template.

##### Embedding Images

To embed images into your email you can assign the `ContentId` field with a unique value that will also be used in your email.

For example:

```csharp
emailMessage
.Attach(new Attachment
{
Name = "My Image",
Bytes = myBytes,
ContentId = "my-image"
});
```

```html
<html>
<img src="cid:my-image" />
</html>
```

Coravel will automatically link the embedded resources to the email properly for you.

#### Auto-Detect Email Address And Name

Using an `object` that has a `public` field or property `Email` and `Name`, you can pass it to the `To()` method.
Expand Down
2 changes: 1 addition & 1 deletion Src/IntegrationTests/TestMvcApp/TestMvcApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>.net6.0</TargetFramework>
<TargetFramework>.net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Src/IntegrationTests/Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>.net6.0</TargetFramework>
<TargetFramework>.net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Src/UnitTests/CoravelUnitTests/CoravelUnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>.net6.0</TargetFramework>
<TargetFramework>.net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Src/UnitTests/MailerUnitTests/MailerUnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>.net6.0</TargetFramework>
<TargetFramework>.net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down

0 comments on commit 2b24ed5

Please sign in to comment.